Let N=d
1d
2d
3...d
n be an n-digit decimal number, with n>1.
Form the sum:
S(N) = d1n + d2n+ d3n + ... + dnn
Prove that there are only a finite number of integers N for which S(N)=N.
For an extra credit, find these values of N.
Not a proof, but the first several such numbers (I started with n=1 instead of n>1) are:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474, 54748, 92727, 93084, 548834, 1741725, ...]
oeis (A005188) calls these Armstrong (or pluperfect, or Plus Perfect, or narcissistic) numbers: m-digit positive numbers equal to sum of the m-th powers of their digits.
The claim is that there are only 88 such numbers (87 if you start with n>1)
[edit: correction, 79 if you start with n>1; I was throwing out only the number 1 rather than all 1-digit numbers]
------------------
def sopod(n):
ans = 0
digits = [int(k) for k in str(n)]
length = len(digits)
for d in digits:
ans += d**length
return ans
ans = []
for n in range(1, 10000000):
if n == sopod(n):
print(n)
ans.append(n)
Edited on March 16, 2024, 11:52 am
|
Posted by Larry
on 2024-03-15 12:59:10 |