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 happy number > 1 in base n.
2

%I #9 May 28 2020 05:28:04

%S 2,3,2,5,6,7,8,3,7,11,12,13,14,15,2,17,2,5,2,21,22,23,24,5,26,27,28,3,

%T 2,31,32,33,3,35,6,31,38,39,40,13,42,43,44,45,46,47,48,7,50,51,52,31,

%U 54,53,56,57,58,59,54,61,62,63,8,65,66,67,12,69,70,71,72

%N Smallest happy number > 1 in base n.

%H Amiram Eldar, <a href="/A161871/b161871.txt">Table of n, a(n) for n = 2..1001</a>

%t happyQ[n_, b_] := NestWhile[Plus @@ (IntegerDigits[#, b]^2) &, n, UnsameQ, All] == 1; a[b_] := Module[{k=2}, While[!happyQ[k,b], k++]; k]; Array[a, 100, 2] (* _Amiram Eldar_, May 28 2020 *)

%Y Cf. A007770 (happy numbers in base 10).

%K nonn,base

%O 2,1

%A _Jud McCranie_, Jun 20 2009