A237819 Number of primes p < n such that floor(sqrt(n-p)) is a Sophie Germain prime.
0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 6, 6, 6, 7, 6, 7, 7, 7, 6, 7, 6, 6, 7, 7, 5, 6, 5, 6, 6, 6, 4, 4, 4, 5, 5, 5, 5, 6, 5, 6, 5, 5, 6, 7, 6, 6, 6, 6, 5, 6, 5, 5
Offset: 1
Keywords
Examples
a(6) = 1 since 2, floor(sqrt(6-2)) = 2 and 2*2 + 1 = 5 are all prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
f[n_]:=Floor[Sqrt[n]] q[n_]:=PrimeQ[f[n]]&&PrimeQ[2*f[n]+1] a[n_]:=Sum[If[q[n-Prime[k]],1,0],{k,1,PrimePi[n-1]}] Table[a[n],{n,1,80}]
Comments