OFFSET
1,4
COMMENTS
Conjecture: (i) a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 5, 6, 7, 8, 16, 17, 22, 23, 148, 149.
(ii) For any integer n > 2, there is a prime p < n with pi(n-p) a triangular number.
We have verified that a(n) > 0 for every n = 3, ..., 1.5*10^7. See A237710 for the least prime p < n with pi(n-p) a square.
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(8) = 1 since 7 is prime with pi(8-7) = 0^2.
a(16) = 1 since 7 is prime with pi(16-7) = 2^2.
a(149) = 1 since 139 is prime with pi(149-139) = pi(10) = 2^2.
a(637) = 2 since 409 is prime with pi(637-409) = pi(228) = 7^2, and 613 is prime with pi(637-613) = pi(24) = 3^2.
MATHEMATICA
SQ[n_]:=IntegerQ[Sqrt[n]]
q[n_]:=SQ[PrimePi[n]]
a[n_]:=Sum[If[q[n-Prime[k]], 1, 0], {k, 1, PrimePi[n-1]}]
Table[a[n], {n, 1, 70}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 11 2014
STATUS
approved