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 A342165 #19 Mar 04 2021 14:59:30 %S A342165 1,2,3,2,4,3,5,2,4,3,6,5,7,2,4,3,8,6,9,5,7,2,10,4,3,8,6,9,11,5,12,7,2, %T A342165 10,4,3,13,8,6,9,14,11,15,5,12,7,16,2,10,4,3,13,17,8,6,9,14,11,18,15, %U A342165 19,5,12,7,16,2,20,10,4,3,21,13,22,17,8,6,9,14 %N A342165 A fractal-like sequence: erase the terms that have a prime index, the non-erased terms rebuild the original sequence. %C A342165 To build the sequence, we start with a(1) = 1 and always extend it with the smallest integer not yet used, except in the case where the number is imposed by the constraint (i.e. if the index is nonprime). This fractal-like sequence takes arbitrarily large values. %H A342165 Michael S. Branicky, <a href="/A342165/b342165.txt">Table of n, a(n) for n = 1..10000</a> %F A342165 a(prime(i)) = i + 1. - _Michael S. Branicky_, Mar 04 2021 %e A342165 Original sequence: 1,2,3,2,4,3,5,2,4,3,6,5,7,2,4,3,8,6,9,5,7,2,10,4,3 %e A342165 Erasing: 1,(2,3,)2,(4,)3,(5,)2,4,3,(6,)5,(7,)2,4,3,(8,)6,(9,)5,7,2,(10,)4,3 %e A342165 Non-erased: 1,( )2,( )3,( )2,4,3,( )5,( )2,4,3,( )6,( )5,7,2,( )4,3 %e A342165 The non-erased terms rebuild the original sequence. %o A342165 (Python) %o A342165 from sympy import isprime %o A342165 def aupton(terms): %o A342165 alst, idx = [1], 1 %o A342165 for n in range(2, terms+1): %o A342165 if isprime(n): an = max(alst) + 1 %o A342165 else: an, idx = alst[idx], idx + 1 %o A342165 alst.append(an) %o A342165 return alst %o A342165 print(aupton(78)) # _Michael S. Branicky_, Mar 03 2021 %o A342165 (PARI) a(n) = while(n>1 && !isprime(n), n-=primepi(n)); primepi(n)+1; \\ _Kevin Ryde_, Mar 03 2021 %Y A342165 Cf. A303845. %K A342165 base,nonn %O A342165 1,2 %A A342165 _Jean-Marc Falcoz_ and _Eric Angelini_, Mar 03 2021 %E A342165 a(26) and beyond from _Michael S. Branicky_, Mar 03 2021