cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A001273 Smallest number that takes n steps to reach 1 under iteration of sum-of-squares-of-digits map (= smallest "happy number" of height n).

Original entry on oeis.org

1, 10, 13, 23, 19, 7, 356, 78999
Offset: 0

Views

Author

Keywords

Comments

Subsequent terms are too large to display in full.
a(8) = 3789 * 10^973 - 1 (3788 followed by 973 9's).
a(9) = 78889 * 10^((a(8) - 305)/81) - 1 (78888 followed by (421 * 10^973 - 34)/9 9's, specified by Warut Roonguthai for UPINT3).
a(10) = 259 * 10^((a(9) - 93)/81) - 1.
a(11) = 179 * 10^((a(10) - 114)/81) - 1.
a(12) = 47 * 10^((a(11) - 52)/81) - 1.
From Ya-Ping Lu, Jul 26 2025: (Start)
a(13) = 137 * 10^((a(12) - 46)/81) - 1.
a(14) = 1128 * 10^((a(13) - 55)/81) - 1.
a(15) = 58 * 10^((a(14) - 74)/81) - 1.
a(16) = 228 * 10^((a(15) - 57)/81) - 1. (End)

References

  • Richard K. Guy, Unsolved Problems in Number Theory, Sect. E34. (2nd ed. UPINT2 = 1994, 3rd ed. UPINT3 = 2004)

Crossrefs

Programs

  • Python
    f = lambda h: sum(int(d)**2 for d in str(h)); a = 356; n_mx = 19
    for n in range(7, n_mx+1):
        b = a%81; a1 = max(a%(2*3**(3*(n_mx+1-n))), b); t = max(a1//81-6,0); h = 1
        while f((h+1)*10**t - 1) != a1:
            h += 1; s = str(h)
            if '0' in s: p0 = s.index('0'); c = 10**(len(s)-p0); h = h//c*c + int(s[p0-1])*(c-1)//9
        c9 = str(h).count('9'); hc = h//(10**c9); a = (hc+1)*10**((a1-f(hc))//81)-1
        print('a(',n,') =', hc+1,'x 10 ^ ( ( a(',n-1,') -', f(hc),') / 81) - 1')  # Ya-Ping Lu, Jul 26 2025

Formula

For n >= 7, a(n) = k(n)*10^((a(n-1)-A003132(k(n)-1))/81)-1, where k(n) = 79, 3789, 78889, 259, 179, 47, 137, 1128, 58, 228, 19, 34, 145 for n = 7, 8,.., 19. - Ya-Ping Lu, Jul 27 2025

Extensions

a(7), a(8) from Jud McCranie, Sep 15 1994
a(9)-a(12) from Hans Havermann, May 02 2010
Edited by Hans Havermann, May 03 2010, May 04 2010