A252648 Irregular table of perfect digital invariants for n > 1, i.e., numbers equal to the sum of n-th powers of their digits, read by rows.
1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 0, 1, 153, 370, 371, 407, 0, 1, 1634, 8208, 9474, 0, 1, 4150, 4151, 54748, 92727, 93084, 194979, 0, 1, 548834, 0, 1, 1741725, 4210818, 9800817, 9926315, 14459929, 0, 1, 24678050, 24678051, 88593477, 0, 1, 146511208, 472335975, 534494836, 912985153, 0, 1, 4679307774
Offset: 0
Examples
The table starts: 1; (n = 0; 1 = 1^0.) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; (n = 1) 0, 1; (n = 2) 0, 1, 153, 370, 371, 407; (n = 3, A046197) 0, 1, 1634, 8208, 9474; (n = 4, A052455) 0, 1, 4150, 4151, 54748, 92727, 93084, 194979; (n = 5, A052464) 0, 1, 548834; (n = 6) 0, 1, 1741725, 4210818, 9800817, 9926315, 14459929; (n = 7, A124068) 0, 1, 24678050, 24678051, 88593477; (n = 8, A124069) 0, 1, 146511208, 472335975, 534494836, 912985153; (n = 9, A226970) The third column corresponds to A003321. The term 153 is member of the row n=3 because 153 = 1^3 + 5^3 + 3^3. - _M. F. Hasler_, Apr 14 2015
Links
- Don Knuth, Table of a(n) for n=0..732
- Don Knuth, CWEB program to generate solutions
Crossrefs
Programs
-
PARI
row(n)={m=1;while(m*9^n>=10^m,m++);for(k=1,10^m,sum(i=1,#d=digits(k),d[i]^n)==k && print1(k,", "))} for(n=0,7,print1(row(n),", "))
-
Python
from itertools import combinations_with_replacement A252648_list = [1] for m in range(1,21): l, L, dm, xlist, q = 1, 1, [d**m for d in range(10)], [0], 9**m while l*q >= L: for c in combinations_with_replacement(range(1,10),l): n = sum(dm[d] for d in c) if sorted(int(d) for d in str(n)) == [0]*(len(str(n))-len(c))+list(c): xlist.append(n) l += 1 L *= 10 A252648_list.extend(sorted(xlist)) # Chai Wah Wu, Jan 04 2016
Extensions
I added two links. - Don Knuth, Sep 10 2015
Comments