OFFSET
1,9
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
For n=3, p=5, there are no primes q(<5) such that both 5+q+1 and 5+q-1 are primes and hence a(3)=0. Also for n=5, p=11, there is a(5)=1 solution 7 since 11+7+1=19, 11+7-1=17.
MATHEMATICA
Table[p = Prime[n]; c = 0; i = 1; While[i < n, p1 = p + Prime[i]; If[PrimeQ[p1 + 1] && PrimeQ[p1 - 1], c = c + 1]; i++]; c, {n, 85}]
pq1[n_]:=Module[{pr1=Prime[Range[n-1]], pr2=Prime[n]}, Total[ Table[ If[ AllTrue[pr2+pr1[[k]]+{1, -1}, PrimeQ], 1, 0], {k, Length[pr1]}]]]; Array[ pq1, 100] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 20 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jayanta Basu, Apr 21 2013
STATUS
approved