Problem 45249. Frugal number
check whether n is a frugal number
- a frugal number is a natural number in a given number base that has more digits than the number of digits in its prime factorization in the given number base
Solution Stats
Problem Comments
-
3 Comments
I'm confused. My solution followed the definition of frugal numbers from https://en.wikipedia.org/wiki/Frugal_number, which includes counting the number of digits in the exponents, and also checks frugality in other bases (not just base 10). But most solutions don't follow this. Can you clarify this?
It seems that the problem is not considering the exponent 1 as a valid digit, For instance, 115248 (6 digits) is called a frugal number in this problem since 115248 (6 digits) > 2^4*3*7^4 (5 digits). If we considered 3^1 as 2 digits instead of the 1-digit 3, 115248 should not be frugal. And the problem should have probably declared this restriction and that the considered base is 10.
PS: The OEIS also imposes this same restriction https://oeis.org/A046759, since 3645 is considered frugal: 3^6*5 instead of 3^6*5^1.
I recommend including the number 414720 to the test suite: 3^4*2^10*5.
Solution Comments
Show commentsProblem Recent Solvers46
Suggested Problems
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1858 Solvers
-
How long is the longest prime diagonal?
399 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
484 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
770 Solvers
-
Remove element(s) from cell array
1748 Solvers
More from this Author165
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!