id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > listNumPrimeFactors
prev  |  next  |  chance

Return an array of integers indicating the number of prime factors each of the integers from 2 up to the input parameter has. For example, listNumPrimeFactors(4) returns {1, 1, 2} because 2 has one prime factor (itself), 3 also has one prime factor, and 4 has two prime factors.


listNumPrimeFactors(2) → [1]
listNumPrimeFactors(3) → [1, 1]
listNumPrimeFactors(4) → [1, 1, 2]

...Save, Compile, Run (ctrl-enter)

public int[] listNumPrimeFactors(int maxNum) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 440

Copyright Nick Parlante 2017 - privacy