A238585 Number of primes p < n with prime(p)^2 + (prime(n)-1)^2 prime.
0, 0, 0, 1, 1, 0, 1, 2, 2, 1, 1, 1, 3, 2, 3, 2, 2, 3, 1, 5, 1, 1, 3, 2, 4, 5, 2, 4, 3, 4, 1, 4, 5, 3, 4, 6, 3, 2, 2, 2, 2, 1, 8, 1, 3, 4, 7, 2, 5, 3, 2, 2, 4, 7, 4, 3, 2, 3, 5, 7, 5, 3, 6, 6, 5, 3, 4, 5, 2, 2, 2, 3, 7, 2, 3, 7, 3, 4, 10, 3
Offset: 1
Keywords
Examples
a(7) = 1 since 3 and prime(3)^2 + (prime(7)-1)^2 = 5^2 + 16^2 = 281 are both prime. a(44) = 1 since 23 and prime(23)^2 + (prime(44)-1)^2 = 83^2 + 192^2 = 43753 are both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014.
Programs
-
Mathematica
p[n_,k_]:=PrimeQ[k]&&PrimeQ[Prime[k]^2+(Prime[n]-1)^2] a[n_]:=Sum[If[p[n,k],1,0],{k,1,n-1}] Table[a[n],{n,1,80}]
Comments