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”).

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

%I #8 Jul 11 2019 14:53:21

%S 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,

%T 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,

%U 4,2,9,3,36,6,29,16,4,2,9,3,36,6,29,16,4,2,9,3

%N 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.

%H Colin Barker, <a href="/A092952/b092952.txt">Table of n, a(n) for n = 1..1000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/UnhappyNumber.html">Unhappy Numbers</a>

%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1).

%F From _Colin Barker_, Jul 11 2019: (Start)

%F 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)).

%F a(n) = a(n-8) for n>8.

%F (End)

%e 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.

%o (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

%K nonn,base,easy

%O 1,1

%A _Sergio Pimentel_, Apr 23 2004

%E Edited by _Charles R Greathouse IV_, Aug 03 2010