amath 1=1^3=(1)^3 endmath,
amath 512=8^3=(5+1+2)^3 endmath,
amath 4913=17^3=(4+9+1+3)^3 endmath,
amath 5832=18^3=(5+8+3+2)^3 endmath,
amath 17576=26^3=(1+7+5+7+6)^3 endmath,
and amath 19683=27^3=(1+9+6+8+3)^3 amath.
- Prove there are no larger Dudeney numbers.
- Find all numbers where the fourth power of the digit sum is equal to the number itself.
Solution 1 after the jump, Solution 2 next week.
- I've done this all by hand, and I'll write it out here(save a bunch of space consuming checks at the end) then post python code I used to check the solutions more efficiently.
First, let's show that sufficiently large numbers cannot be Dudeney (Thanks to Hostile Fork for the idea). Note that
amath DigitSum ( n ) <= 9 * DigitCount ( n ) endmath and amath DigitCount ( n ) < log_10 ( n ) + 1 endmath so amath DigitSum ( n ) < 9*log_10 ( n ) + 9 endmath. amath n^3 endmath is a Dudeney number if and only if amath n = DigitSum ( n^3 ) endmath. This means amath n < 27*log_10 ( n ) + 9 endmath. By hand, it's clear that amath 10^2=100 endmath is an upper bound for amath n endmath. Solving the inequity above with a computer shows that amath n < 57 endmath. Either way,now we can check each possible n to see if it is a Dudeney number. 19683 is indeed the largest Dudeney number. Here's my code. - If you looked at my code above, the solution here should be obvious. We know we want amath n = DigitSum ( n^4 ) endmath, so amath n < 36*log_10 ( n ) + 9 endmath.This gives us amath n<77 endmath. Testing cases gives us that 1, 2401, 234256, 390625, 614656, and 1679616 are the fourth powers which satisfy our condition. My code.
No comments:
Post a Comment