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 A358180 #24 Nov 06 2022 01:40:29 %S A358180 1,30,162,1150,11603,104511,1041245,10226995,101514698,1008495923, %T A358180 10060201866 %N A358180 Indices for A358168. %C A358180 a(6)-a(7) from Chuck Gaydos. %t A358180 nn = 2^20; q[_] = False; q[0] = True; a[_] = 0; c[_] = -1; c[0] = 2; m = 1; {1}~Join~Reap[Do[j = c[m]; a[n] = m; c[m] = n; m = 0; If[j > 0, m = n - j]; If[! q[#2], Sow[n]; q[#2] = True] & @@ {a[n], IntegerLength[a[n]]}, {n, 3, nn}] ][[-1, -1]] (* _Michael De Vlieger_, Nov 05 2022 *) %o A358180 (Python) %o A358180 from itertools import count %o A358180 def A358180(n): %o A358180 b, bdict, k = 0, {0:(1,)},10**(n-1) if n > 1 else 0 %o A358180 for m in count(2): %o A358180 if b >= k: %o A358180 return m-1 %o A358180 if len(l := bdict[b]) > 1: %o A358180 b = m-1-l[-2] %o A358180 if b in bdict: %o A358180 bdict[b] = (bdict[b][-1],m) %o A358180 else: %o A358180 bdict[b] = (m,) %o A358180 else: %o A358180 b = 0 %o A358180 bdict[0] = (bdict[0][-1],m) # _Chai Wah Wu_, Nov 05 2022 %Y A358180 Cf. A181391, A358168. %K A358180 nonn,hard,more %O A358180 1,2 %A A358180 _G. L. Honaker, Jr._, Nov 02 2022 %E A358180 a(8) from _Michael De Vlieger_, Nov 05 2022 %E A358180 a(9)-a(10) from _Chai Wah Wu_, Nov 05 2022 %E A358180 a(11) from _Martin Ehrenstein_, Nov 05 2022