Problem 55370. Easy Sequences 69: Radix Economy of Factorials
The Radix Economy of a number in a particular base is the number of digits needed to express it in that base, multiplied by the base. In functional form we write:
, where E is the radix econony, b and N, are the base and number, respectively, and
, is the number of digits of the base-b representation of N.
For example, if
and
, then the radix economy is
:
>> E = 2 * length(dec2bin(1000))
>> E =
20
Given a base b, and an integer n, calculate
, for
.
For example, if
and
, we have:
>> F = 3 * length(dec2base(factorial(10),3))
>> F =
42
----------------
NOTE: As it is, this problem is quite simple. In fact, a solution is already given for small values of b and n. Therefore, to make it a bit interesting, some built-in functions are disabled.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
Increment a number, given its digits
663 Solvers
-
Recurring Cycle Length (Inspired by Project Euler Problem 26)
131 Solvers
-
1490 Solvers
-
Project Euler: Problem 18, Maximum path sum I
104 Solvers
-
Easy Sequences 2: Trigonometric function with integral input and output
37 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!