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.
%I A001273 #65 Jul 31 2025 22:30:46 %S A001273 1,10,13,23,19,7,356,78999 %N 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). %C A001273 Subsequent terms are too large to display in full. %C A001273 a(8) = 3789 * 10^973 - 1 (3788 followed by 973 9's). %C A001273 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). %C A001273 a(10) = 259 * 10^((a(9) - 93)/81) - 1. %C A001273 a(11) = 179 * 10^((a(10) - 114)/81) - 1. %C A001273 a(12) = 47 * 10^((a(11) - 52)/81) - 1. %C A001273 From _Ya-Ping Lu_, Jul 26 2025: (Start) %C A001273 a(13) = 137 * 10^((a(12) - 46)/81) - 1. %C A001273 a(14) = 1128 * 10^((a(13) - 55)/81) - 1. %C A001273 a(15) = 58 * 10^((a(14) - 74)/81) - 1. %C A001273 a(16) = 228 * 10^((a(15) - 57)/81) - 1. (End) %D A001273 Richard K. Guy, Unsolved Problems in Number Theory, Sect. E34. (2nd ed. UPINT2 = 1994, 3rd ed. UPINT3 = 2004) %H A001273 Tianxin Cai and Xia Zhou, <a href="http://projecteuclid.org/euclid.rmjm/1225114174">On The Heights of Happy Numbers</a>, Rocky Mountain J. Math., Vol. 38, No. 6 (2008), 1921-1926. %H A001273 H. G. Grundman and E. A. Teeple, <a href="https://www.fq.math.ca/Scanned/41-4/grundman.pdf">Heights of happy numbers and cubic happy numbers</a>, Fib Quart. 41 (4) (2003) 301-306. %H A001273 Hans Havermann, <a href="http://chesswanks.com/blahg/odo/Blog/Entries/2010/5/2_Big_and_happy.html">Big and Happy</a> %H A001273 Gabriel Lapointe, <a href="https://arxiv.org/abs/1904.12032">On finding the smallest happy numbers of any heights</a>, arXiv:1904.12032 [math.NT], 2019. %H A001273 May Mei and Andrew Read-McFarland, <a href="http://arxiv.org/abs/1511.01441">Numbers and the Heights of their Happiness</a>, arXiv:1511.01441 [math.NT], 2015. %F A001273 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 %o A001273 (Python) %o A001273 f = lambda h: sum(int(d)**2 for d in str(h)); a = 356; n_mx = 19 %o A001273 for n in range(7, n_mx+1): %o A001273 b = a%81; a1 = max(a%(2*3**(3*(n_mx+1-n))), b); t = max(a1//81-6,0); h = 1 %o A001273 while f((h+1)*10**t - 1) != a1: %o A001273 h += 1; s = str(h) %o A001273 if '0' in s: p0 = s.index('0'); c = 10**(len(s)-p0); h = h//c*c + int(s[p0-1])*(c-1)//9 %o A001273 c9 = str(h).count('9'); hc = h//(10**c9); a = (hc+1)*10**((a1-f(hc))//81)-1 %o A001273 print('a(',n,') =', hc+1,'x 10 ^ ( ( a(',n-1,') -', f(hc),') / 81) - 1') # _Ya-Ping Lu_, Jul 26 2025 %Y A001273 Cf. A003132, A007770, A018785, A176762. %K A001273 nonn,base %O A001273 0,2 %A A001273 _N. J. A. Sloane_ %E A001273 a(7), a(8) from _Jud McCranie_, Sep 15 1994 %E A001273 a(9)-a(12) from _Hans Havermann_, May 02 2010 %E A001273 Edited by _Hans Havermann_, May 03 2010, May 04 2010