A239330 Number of odd primes p <= n with pi(n*(p+1)/2) - pi(n*(p-1)/2) prime, where pi(x) denotes the number of primes not exceeding x.
0, 0, 0, 1, 1, 2, 2, 3, 3, 2, 4, 2, 5, 3, 3, 4, 1, 3, 4, 4, 5, 4, 4, 4, 4, 3, 3, 5, 5, 5, 3, 6, 8, 5, 5, 3, 5, 6, 4, 4, 7, 6, 4, 4, 3, 5, 3, 4, 3, 5, 4, 4, 3, 3, 4, 2, 4, 2, 4, 4, 3, 4, 9, 3, 7, 4, 6, 4, 5, 5, 7, 4, 9, 9, 7, 7, 11, 7, 8, 8
Offset: 1
Keywords
Examples
a(4) = 1 since 3 and pi(4*(3+1)/2) - pi(4*(3-1)/2) = pi(8) - pi(4) = 4 - 2 = 2 are both prime. a(5) = 1 since 5 and pi(5*(5+1)/2) - pi(5*(5-1)/2) = pi(15) - pi(10) = 6 - 4 = 2 are both prime. a(17) = 1 since 11 and pi(17*(11+1)/2) - pi(17*(11-1)/2) = pi(102) - pi(85) = 26 - 23 = 3 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[PrimePi[n*(Prime[k]+1)/2]-PrimePi[n*(Prime[k]-1)/2]] a[n_]:=Sum[If[p[n,k],1,0],{k,2,PrimePi[n]}] Table[a[n],{n,1,80}]
Comments