A032799 Numbers k such that k equals the sum of its digits raised to the consecutive powers (1,2,3,...).
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 89, 135, 175, 518, 598, 1306, 1676, 2427, 2646798, 12157692622039623539
Offset: 1
Examples
89 = 8^1 + 9^2. 175 = 1^1 + 7^2 + 5^3. 2427 = 2^1 + 4^2 + 2^3 + 7^4. 2646798 = 2^1 + 6^2 + 4^3 + 6^4 + 7^5 + 9^6 + 8^7.
References
- J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 175, p. 55, Ellipses, Paris 2008.
- Ken Follett, Code to Zero, Dutton, a Penguin Group, NY 2000, p. 84.
- Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 37.
- D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, London, 1986, Entry 175.
Links
- Rosetta Code, Disarium numbers.
- Tim Cross, Problem 2002.1, Student Problems, The Mathematical Gazette, Vol. 86, No. 505 (2002), p. 152.
- Shyam Sunder Gupta, Digital Invariants and Narcissistic Numbers, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 21, 513-526.
- Eric Weisstein's World of Mathematics, Narcissistic Number.
Programs
-
Maple
N:= 10: # to get solutions of up to N digits Branch:= proc(level,sofar) option remember; local Res, x, x0, lb, ub, y; Res:= NULL; if perm[level] = 1 then x0:= 1 else x0:= 0 fi; for x from x0 to 9 do lb:= sofar + b[x,perm[level]] + scmin[level]; ub:= sofar + b[x,perm[level]] + scmax[level]; if lb <= 0 and ub >= 0 then if level = n then Res:= Res, [x] else for y in Branch(level+1,sofar+b[x,perm[level]]) do Res:= Res, [x, op(y)] od fi fi od; [Res] end: count:= 0: for n from 1 to N do printf("Looking for %d digit solutions\n",n); forget(Branch); for j from 1 to n do for x from 0 to 9 do b[x,j]:= x^j - x*10^(n-j) od od: for j from 1 to n do smin[j]:= min(seq(b[x,j],x=0..9)); smax[j]:= max(seq(b[x,j],x=0..9)); od: perm:= sort([seq(smax[j]-smin[j],j=1..n)],`>`,output=permutation): for j from 1 to n do scmin[j]:= add(smin[perm[i]],i=j+1..n); scmax[j]:= add(smax[perm[i]],i=j+1..n); end; for X in Branch(1,0) do xx:= add(X[i]*10^(n-perm[i]),i=1..n); count:= count+1; A[count]:= xx; print(xx); od od: seq(A[i],i=1..count); # Robert Israel, Aug 07 2014
-
Mathematica
f[n_] := Plus @@ (IntegerDigits[n]^Range[ Floor[ Log[10, n] + 1]]); Select[ Range[10^7], f[ # ] == # &] (* Robert G. Wilson v, May 04 2005 *) Join[{0},Select[Range[10^7],Total[IntegerDigits[#]^Range[ IntegerLength[ #]]] == #&]] (* Harvey P. Dale, Oct 13 2015 *) 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 *)
-
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
Extensions
Corrected by Macsy Zhang (macsy(AT)21cn.com), Feb 17 2002
Comments