A238733 Number of primes p < n such that floor((n-p)/3) = (q-1)*(q-3)/8 for some prime q.
0, 0, 1, 2, 2, 3, 3, 3, 2, 2, 2, 4, 3, 4, 3, 4, 2, 3, 1, 3, 3, 4, 2, 3, 1, 2, 2, 3, 1, 2, 1, 4, 5, 5, 3, 2, 2, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 6, 5, 5, 4, 5, 3, 4, 2, 3, 3, 4, 2, 3, 3, 5, 5, 5, 2, 2, 1, 4, 4, 4, 3, 4, 3, 4, 4, 5, 4, 4, 1, 2
Offset: 1
Keywords
Examples
a(25) = 1 since floor((25-23)/3) = 0 = (3-1)*(3-3)/8 with 23 and 3 both prime. a(96) = 1 since floor((96-11)/3) = 28 = (17-1)*(17-3)/8 with 11 and 17 both prime. a(409) = 1 since floor((409-379)/3) = 10 = (11-1)*(11-3)/8 with 379 and 11 both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, On sums of primes and triangular numbers, J. Comb. Number Theory 1(2009), no.1, 65-76. arXiv:0803.3737.
- Zhi-Wei Sun, Problems on combinatorial properties of primes, 1402.6641, 2014.
Programs
-
Mathematica
TQ[n_]:=PrimeQ[Sqrt[8n+1]+2] t[n_,k_]:=TQ[Floor[(n-Prime[k])/3]] a[n_]:=Sum[If[t[n,k],1,0],{k,1,PrimePi[n-1]}] Table[a[n],{n,1,80}]
-
PARI
has(x)=issquare(8*x+1,&x) && isprime(x+2) a(n)=my(s); forprime(p=2,n-1,s+=has((n-p)\3)); s \\ Charles R Greathouse IV, Mar 03 2014
Comments