cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A252648 #45 May 15 2020 04:40:00
%S A252648 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,
%T A252648 4150,4151,54748,92727,93084,194979,0,1,548834,0,1,1741725,4210818,
%U A252648 9800817,9926315,14459929,0,1,24678050,24678051,88593477,0,1,146511208,472335975,534494836,912985153,0,1,4679307774
%N 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.
%C A252648 The third column is listed in A003321. - _M. F. Hasler_, Feb 16 2015
%C A252648 For a number x >= 10^(d-1) with d digits, the sum of n-th powers of these digits cannot exceed d*9^n. Therefore there is only a finite number of possible perfect digital invariants for any n, the largest of which has at most d* digits, where d* = 1+(n*log(9)+log d*)/log(10). - _M. F. Hasler_, Apr 14 2015
%H A252648 Don Knuth, <a href="http://www-cs-faculty.stanford.edu/~knuth/perfect_digital_invariants.txt">Table of a(n) for n=0..732</a>
%H A252648 Don Knuth, <a href="http://www-cs-faculty.stanford.edu/~knuth/programs/back-pdi.w">CWEB program to generate solutions</a>
%e A252648 The table starts:
%e A252648 1; (n = 0; 1 = 1^0.)
%e A252648 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; (n = 1)
%e A252648 0, 1; (n = 2)
%e A252648 0, 1, 153, 370, 371, 407; (n = 3, A046197)
%e A252648 0, 1, 1634, 8208, 9474; (n = 4, A052455)
%e A252648 0, 1, 4150, 4151, 54748, 92727, 93084, 194979; (n = 5, A052464)
%e A252648 0, 1, 548834; (n = 6)
%e A252648 0, 1, 1741725, 4210818, 9800817, 9926315, 14459929; (n = 7, A124068)
%e A252648 0, 1, 24678050, 24678051, 88593477; (n = 8, A124069)
%e A252648 0, 1, 146511208, 472335975, 534494836, 912985153; (n = 9, A226970)
%e A252648 The third column corresponds to A003321.
%e A252648 The term 153 is member of the row n=3 because 153 = 1^3 + 5^3 + 3^3. - _M. F. Hasler_, Apr 14 2015
%o A252648 (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,", "))}
%o A252648 for(n=0,7,print1(row(n),", "))
%o A252648 (Python)
%o A252648 from itertools import combinations_with_replacement
%o A252648 A252648_list = [1]
%o A252648 for m in range(1,21):
%o A252648     l, L, dm, xlist, q = 1, 1, [d**m for d in range(10)], [0], 9**m
%o A252648     while l*q >= L:
%o A252648         for c in combinations_with_replacement(range(1,10),l):
%o A252648             n = sum(dm[d] for d in c)
%o A252648             if sorted(int(d) for d in str(n)) == [0]*(len(str(n))-len(c))+list(c):
%o A252648                 xlist.append(n)
%o A252648         l += 1
%o A252648         L *= 10
%o A252648     A252648_list.extend(sorted(xlist)) # _Chai Wah Wu_, Jan 04 2016
%Y A252648 Cf. A003321, A046197, A052455, A052464, A124068, A124069, A226970.
%Y A252648 Cf. A255668 (row lengths).
%K A252648 nonn,base,tabf
%O A252648 0,4
%A A252648 _Derek Orr_, Dec 19 2014
%E A252648 I added two links. - _Don Knuth_, Sep 10 2015