OFFSET
1,3
COMMENTS
According to the conjecture in A237706, a(n) should be positive for all n > 2.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Z.-W. Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014
EXAMPLE
a(5) = 3 since pi(5-3) = 1^2, but pi(5-2) = 2 is not a square.
MATHEMATICA
SQ[n_]:=IntegerQ[Sqrt[n]]
q[n_]:=SQ[PrimePi[n]]
Do[Do[If[q[n-Prime[k]], Print[n, " ", Prime[k]]; Goto[aa]], {k, 1, PrimePi[n-1]}];
Print[n, " ", 0]; Label[aa]; Continue, {n, 1, 100}]
lp[n_]:=Module[{p=2}, While[!IntegerQ[Sqrt[PrimePi[n-p]]], p=NextPrime[p]]; p]; Join[{0, 0}, Array[ lp, 80, 3]] (* Harvey P. Dale, Jan 28 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 12 2014
STATUS
approved