login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A092952
Smallest unhappy number that takes n iterations of the sum of the squares of digits to reach 4, which is the smallest number of the unhappy numbers cycle.
2
4, 2, 11, 113, 78, 58, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3, 36, 6, 29, 16, 4, 2, 9, 3
OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Unhappy Numbers
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
Sequence in context: A094406 A142706 A361216 * A286145 A010318 A188134
KEYWORD
nonn,base,easy
AUTHOR
Sergio Pimentel, Apr 23 2004
EXTENSIONS
Edited by Charles R Greathouse IV, Aug 03 2010
STATUS
approved