%I #28 Feb 13 2019 04:55:46
%S 1,2,43,61,83,103,109,113,151,167,179,181,197,199,233,239,251,263,271,
%T 281,283,313,317,349,353,367,383,389,401,409,421,433,443,457,463,467,
%U 487,499,503,523,547,563,571,577,593,601,607,617,619,641,647,653
%N a(n) is the smallest m such that A000720(m) - A000006(m) = n.
%C From _Jianing Song_, Feb 04 2019: (Start)
%C Let b(m) = A000720(m) - A000006(m).
%C a(n) exists for all n >= -1. Proof: It's easy to show that lim inf b(m) = +oo and b(m+1) - b(m) <= 1 for all m. For every n >= -1, if b(m) = n, then there must exist some m' > m such that b(m') > n. Let m_0 be the smallest among such m', then b((m_0)-1) <= n, so b(m_0) <= b((m_0)-1) + 1 <= n + 1, but b(m_0) > n, so b(m_0) = n + 1. By induction every n >= -1 appears in the range of {b(m)}.
%C It appears that b(m) ~ m/log(m) - sqrt(m*log(m)) + o(1), so each value for {b(m)} should only appear finitely many times (e.g., b(m) = -1 only for m = 1, 10, 12, 16, 26, 27, 28, 35, 36, 40; b(m) = 0 only for some 44 m's).
%C It appears that {a(n)} is an increasing prime sequence, for n >= 0. (End)
%t Table[Min[Flatten[Table[If[PrimePi[m] - IntegerPart[Sqrt[Prime[m]]] == n, m, {}], {m, 1, 500}]]], {n, -1, 20}]
%o (PARI) a(n) = for(m=1,oo,if(primepi(m)-sqrtint(prime(m))==n, return(m))) \\ _Jianing Song_, Feb 04 2019
%Y Cf. A000006, A000720.
%K nonn,less
%O -1,2
%A _Roger L. Bagula_, Apr 21 2008
%E Edited by and more terms from _Jianing Song_, Feb 04 2019