about | help | code help+videos | done | prefs |
Write a function that will return the unique prime factorization of a positive integer. Each positive integer has such a factorization; you should return it as a list of integers, with the smallest integers first. So the factorization of 30 is [2, 3, 5] because 2 * 3 * 5 = 30. It might seem strange, but the prime factorization of 1 is the empty list. You need not worry about 0 and negative numbers; the input is guaranteed to be a positive integer. factorization(30) → [2, 3, 5] factorization(24) → [2, 2, 2, 3] factorization(99) → [3, 3, 11] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 85 Post-solution available
Copyright Nick Parlante 2017 - privacy