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 A335294 #62 Jul 13 2021 01:39:22 %S A335294 1,1,1,0,1,1,1,1,0,0,1,1,2,1,1,0,1,1,2,1,1,0,1,1,1,1,0,0,1,1,2,2,1,1, %T A335294 0,0,1,1,1,1,2,1,2,2,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,2,2,1,1,0,0,1,1, %U A335294 1,1,2,1,2,2,1,0,0,0,1,1,1,1,2,1,1,1,1,0,1,1,1,1,1,1,0,0,1 %N A335294 a(n) = pi(n) - pi(Sum_{k=1..n-1} a(k)) with a(1) = 1, where pi() is the prime counting function A000720. %C A335294 Alkan, Booker, & Luca prove that every nonnegative integer appears infinitely often. %H A335294 Robert Israel, <a href="/A335294/b335294.txt">Table of n, a(n) for n = 1..10000</a> %H A335294 Altug Alkan, Andrew R. Booker, and Florian Luca, <a href="https://arxiv.org/abs/2006.08013">On a recursively defined sequence involving the prime counting function</a>, arXiv:2006.08013 [math.NT], 2020. %p A335294 A[1]:= 1: S:= 1: %p A335294 for n from 2 to 100 do %p A335294 A[n]:= numtheory:-pi(n) - numtheory:-pi(S); %p A335294 S:= S + A[n]; %p A335294 od: %p A335294 seq(A[n],n=1..100); # _Robert Israel_, Jun 01 2020 %t A335294 a[1] = 1; a[n_] := a[n] = PrimePi[n] - PrimePi[Sum[a[k], {k, 1, n-1}]]; Array[a, 100] (* _Amiram Eldar_, Jun 01 2020 *) %t A335294 upto[nn_] := Reap[Block[{i=0, is=0, sp=2, p=2, s=1}, Sow@ 1; Do[ If[n == p, i++; p = NextPrime@ p]; Sow[i - is]; s += i - is; While[ s >= sp, is++; sp = NextPrime@ sp], {n, 2, nn}]]] [[2, 1]]; upto[97] (* _Giovanni Resta_, Jun 02 2020 *) %o A335294 (PARI) a=vector(10^2); a[1] = 1; for(n=2, #a, a[n] = primepi(n) - primepi(sum(k=1, n-1, a[k]))); a %o A335294 (PARI) first(n) = {my(res = vector(n), pp = 0, s = 1, ps=0); primepivec = vector(n); forprime(p = 2, n, primepivec[p] = 1; ); for(i = 2, n, primepivec[i] += primepivec[i-1] ); res[1] = 1; for(i = 2, n, if(isprime(i), pp++); res[i] = pp - ps; s+=(pp-ps); ps = primepivec[s]; ); res } \\ _David A. Corneth_, Jun 01 2020 %o A335294 (Python) %o A335294 from sympy import primepi %o A335294 A = [1] %o A335294 S = 1 %o A335294 for n in range(1, 101): %o A335294 A += [primepi(n+1) - primepi(S), ] %o A335294 S += A[n] %o A335294 print(A) # _Indranil Ghosh_, Jun 21 2020, after Maple %Y A335294 Cf. A000720, A335337 (when k appears), A334714 (partial sums). %K A335294 nonn,easy %O A335294 1,13 %A A335294 _Altug Alkan_, Jun 01 2020