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.
%I A032799 #79 May 24 2025 16:20:42 %S A032799 0,1,2,3,4,5,6,7,8,9,89,135,175,518,598,1306,1676,2427,2646798, %T A032799 12157692622039623539 %N A032799 Numbers k such that k equals the sum of its digits raised to the consecutive powers (1,2,3,...). %C A032799 Lemma: The sequence is finite with all terms in the sequence having at most 22 digits. Proof: Let n be an m-digit natural number in the sequence for some m. Then 10^(m-1)<=n and n<=9+9^2+...9^m = 9(9^m-1)/8<(9^(m+1))/8. Thus 10^(m-1)<(9^(m+1))/8. Taking logarithms of both sides and solving yields m<22.97 QED. Note proof is identical to that for A208130. [_Francis J. McDonnell_, Apr 14 2012] %C A032799 Sometimes referred to as disarium numbers. - _Dumitru Damian_, Jul 22 2024 %D A032799 J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 175, p. 55, Ellipses, Paris 2008. %D A032799 Ken Follett, Code to Zero, Dutton, a Penguin Group, NY 2000, p. 84. %D A032799 Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 37. %D A032799 D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, London, 1986, Entry 175. %H A032799 Rosetta Code, <a href="https://rosettacode.org/wiki/Disarium_numbers">Disarium numbers</a>. %H A032799 Tim Cross, <a href="https://www.jstor.org/stable/3621604">Problem 2002.1</a>, Student Problems, The Mathematical Gazette, Vol. 86, No. 505 (2002), p. 152. %H A032799 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_21">Digital Invariants and Narcissistic Numbers</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 21, 513-526. %H A032799 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/NarcissisticNumber.html">Narcissistic Number</a>. %e A032799 89 = 8^1 + 9^2. %e A032799 175 = 1^1 + 7^2 + 5^3. %e A032799 2427 = 2^1 + 4^2 + 2^3 + 7^4. %e A032799 2646798 = 2^1 + 6^2 + 4^3 + 6^4 + 7^5 + 9^6 + 8^7. %p A032799 N:= 10: # to get solutions of up to N digits %p A032799 Branch:= proc(level,sofar) %p A032799 option remember; %p A032799 local Res, x, x0, lb, ub, y; %p A032799 Res:= NULL; %p A032799 if perm[level] = 1 then x0:= 1 else x0:= 0 fi; %p A032799 for x from x0 to 9 do %p A032799 lb:= sofar + b[x,perm[level]] + scmin[level]; %p A032799 ub:= sofar + b[x,perm[level]] + scmax[level]; %p A032799 if lb <= 0 and ub >= 0 then %p A032799 if level = n then Res:= Res, [x] %p A032799 else %p A032799 for y in Branch(level+1,sofar+b[x,perm[level]]) do %p A032799 Res:= Res, [x, op(y)] %p A032799 od %p A032799 fi %p A032799 fi %p A032799 od; %p A032799 [Res] %p A032799 end: %p A032799 count:= 0: %p A032799 for n from 1 to N do %p A032799 printf("Looking for %d digit solutions\n",n); %p A032799 forget(Branch); %p A032799 for j from 1 to n do %p A032799 for x from 0 to 9 do %p A032799 b[x,j]:= x^j - x*10^(n-j) %p A032799 od %p A032799 od: %p A032799 for j from 1 to n do %p A032799 smin[j]:= min(seq(b[x,j],x=0..9)); %p A032799 smax[j]:= max(seq(b[x,j],x=0..9)); %p A032799 od: %p A032799 perm:= sort([seq(smax[j]-smin[j],j=1..n)],`>`,output=permutation): %p A032799 for j from 1 to n do %p A032799 scmin[j]:= add(smin[perm[i]],i=j+1..n); %p A032799 scmax[j]:= add(smax[perm[i]],i=j+1..n); %p A032799 end; %p A032799 for X in Branch(1,0) do %p A032799 xx:= add(X[i]*10^(n-perm[i]),i=1..n); %p A032799 count:= count+1; %p A032799 A[count]:= xx; %p A032799 print(xx); %p A032799 od %p A032799 od: %p A032799 seq(A[i],i=1..count); # _Robert Israel_, Aug 07 2014 %t A032799 f[n_] := Plus @@ (IntegerDigits[n]^Range[ Floor[ Log[10, n] + 1]]); Select[ Range[10^7], f[ # ] == # &] (* _Robert G. Wilson v_, May 04 2005 *) %t A032799 Join[{0},Select[Range[10^7],Total[IntegerDigits[#]^Range[ IntegerLength[ #]]] == #&]] (* _Harvey P. Dale_, Oct 13 2015 *) %t A032799 sdcpQ[n_]:=n==Inner[Power,IntegerDigits[n],Range[IntegerLength[n]],Plus]; Join[{0},Select[Range[27*10^5],sdcpQ]] (* _Harvey P. Dale_, May 30 2020 *) %o A032799 (PARI) for(n=1,10^22,d=digits(n);s=sum(i=1,#d,d[i]^i);if(s==n,print1(n,", "))) \\ _Derek Orr_, Aug 07 2014 %Y A032799 Cf. A005188, A208130, A362843. %K A032799 nonn,base,fini,full,nice %O A032799 1,3 %A A032799 _Patrick De Geest_, May 15 1998 %E A032799 Corrected by Macsy Zhang (macsy(AT)21cn.com), Feb 17 2002