OFFSET
1,2
LINKS
Shyam Sunder Gupta, Happy Numbers, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 7, 209-222.
EXAMPLE
888 is a term since it is a repdigit number consisting of digit 8 only and is also a happy number (64+64+64 = 192, and 1+81+4 = 86, and 64+36 = 100, and 1+0+0 = 1).
MATHEMATICA
happyQ[n_] := NestWhile[Total[IntegerDigits[#]^2] &, n, UnsameQ, All] == 1; Select[Union[Table[k*(10^n - 1)/9, {k, 1, 9}, {n, 17}] // Flatten], happyQ] (* Amiram Eldar, Apr 14 2025 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Shyam Sunder Gupta, Apr 14 2025
STATUS
approved
