Re:Munchausen Numbers and How to Find Them
by AnimalMuppet on Wednesday September 21, 2016 @05:38PM
(#12552501)
For an 11-digit number, Mun(N) <= 11 * 9^9 = 4,261,625,379 - which only has 10 digits. Therefore, no Munchausen number can have 11 (or more) digits.
For a 10-digit number, Mun(N) <= 10 * 9^9 = 3,874,204,890. So you can stop there.
Re:Munchausen Numbers and How to Find Them
by wolfram74 on Wednesday September 21, 2016 @05:19PM
(#12552343)
Exploring this in other bases would be amusing, maybe not particularly enlightening though.
[spoiler alert] If we assume that the number N has D digits, then
Now, N has D digits, and each one can be at most 9, so If we assume that there exist a number N that is a Munchausen number with D digits, then N = Mun(N) so we can combine the left part of the first equation with the right part of the second equation If we only keep the extreme parts of the inequality And now we can take log (in base 10) And put all the D in the left side: Taking the derivatives, the function f(x)=x-log(x) is essentially increasing if x is big enough, probably when x>1 or x>2, I'm a bit lazy. (Remember to use the ln(10) in the derivative because we are using log=log_10 instead of ln=log_e.)So we have only to find a value of D that is big enough. For example, if D=12, then
So if D is 12 or more, we have a contradiction, so there are no Munchausen numbers with 12 digits or more.A more careful analysis can reduce this value a little, but a for between 1 and 10^12-1 to test all the cases should finish in a modern computer in a reasonable time, specially replacing the pow(n, n) calculation with a cached value.