OFFSET
1,1
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Unhappy Numbers
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,1).
FORMULA
From Colin Barker, Jul 11 2019: (Start)
G.f.: x*(4 + 2*x + 11*x^2 + 113*x^3 + 78*x^4 + 58*x^5 + 29*x^6 + 16*x^7 - 2*x^10 - 110*x^11 - 42*x^12 - 52*x^13) / ((1 - x)*(1 + x)*(1 + x^2)*(1 + x^4)).
a(n) = a(n-8) for n>8.
(End)
EXAMPLE
113 is the fourth number of the sequence because it takes 4 iterations to reach 4: 113 / 1^2 + 1^2 + 3^2 = 11 / 1^2 + 1^2 = 2 / 2^2 = 4.
PROG
(PARI) Vec(x*(4 + 2*x + 11*x^2 + 113*x^3 + 78*x^4 + 58*x^5 + 29*x^6 + 16*x^7 - 2*x^10 - 110*x^11 - 42*x^12 - 52*x^13) / ((1 - x)*(1 + x)*(1 + x^2)*(1 + x^4)) + O(x^80)) \\ Colin Barker, Jul 11 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Sergio Pimentel, Apr 23 2004
EXTENSIONS
Edited by Charles R Greathouse IV, Aug 03 2010
STATUS
approved