login
a(n) = pi(pi(n)) - pi(Sum_{k=1..n-1} a(k)) with a(1) = 0.
1

%I #17 Jun 20 2020 07:26:40

%S 0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,

%T 0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,

%U 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1

%N a(n) = pi(pi(n)) - pi(Sum_{k=1..n-1} a(k)) with a(1) = 0.

%C Conjecture: a(n) hits every nonnegative integer.

%H Altug Alkan, <a href="/A335716/b335716.txt">Table of n, a(n) for n = 1..10000</a>

%H 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.

%e a(10861) = pi(pi(10861)) - pi(Sum_{k=1..10860} a(k))) = 216 - 214 = 2.

%t a[1] = s[1] = 0; a[n_] := a[n] = PrimePi@ PrimePi@ n - PrimePi@ s[n-1]; s[n_] := s[n] = s[n-1] + a[n]; Array[a, 100] (* _Giovanni Resta_, Jun 19 2020 *)

%o (PARI) a=vector(10^2); a[1] = 0; for(n=2, #a, a[n] = primepi(primepi(n)) - primepi(sum(k=1, n-1, a[k]))); a

%Y Cf. A000720, A335294.

%K nonn

%O 1

%A _Altug Alkan_, Jun 18 2020