OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Happy Number.
EXAMPLE
7839, 7840, 7841, 7842 are the first of four consecutive integers each of which is a happy number, hence a(1) = 7839.
MATHEMATICA
f[n_] := Total[IntegerDigits[n]^2]; t = Select[Range[300000], NestWhile[f, #, UnsameQ, All] == 1 &]; t[[Select[Range[Length[t] - 3], t[[#]] == t[[# + 1]] - 1 == t[[# + 2]] - 2 == t[[# + 3]] - 3 &]]] (* T. D. Noe, Aug 22 2011 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Martin Renner, Aug 22 2011
STATUS
approved