A219023
Number of primes p
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 0, 1, 1, 0, 0, 2, 1, 0, 2, 0, 0, 0, 2, 1, 1, 0, 2, 1, 0, 2, 3, 0, 2, 2, 0, 1, 4, 1, 2, 1, 0, 0, 3, 1, 1, 3, 0, 0, 1, 2, 1, 1, 1, 1, 0, 0, 2, 3, 1, 0, 3, 1, 2, 1, 0, 1, 4, 0, 1, 2, 0, 2, 3, 0, 0, 4, 0, 2, 2, 0, 1, 3, 2, 1, 4, 1, 1, 3, 3, 2, 3, 1, 2, 1, 0, 2, 4, 2
Offset: 1
Keywords
Examples
a(12)=2 since the 5 and 7 are the only primes p<12 with 12^2-12+p and 12^2+12-p both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..20000
- Zhi-Wei Sun, Conjectures involving primes and quadratic forms, arXiv preprint arXiv:1211.1588 [math.NT], 2012-2017.
- Wikipedia, Oppermann's conjecture
Crossrefs
Cf. A000040.
Programs
-
Mathematica
a[n_]:=a[n]=Sum[If[PrimeQ[n^2-n+Prime[k]]==True&&PrimeQ[n^2+n-Prime[k]]==True,1,0],{k,1,PrimePi[n-1]}] Do[Print[n," ",a[n]],{n,1,20000}] Table[Total[Table[If[AllTrue[{k^2-k+p,k^2+k-p},PrimeQ],1,0],{p,Prime[ Range[ PrimePi[k]]]}]],{k,100}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 23 2017 *)
-
PARI
A219023(n)={my(c=0,nm=n^2-n,np=n^2+n); forprime(p=1,n-1,isprime(np-p) && isprime(nm+p) && c++); c} \\ - M. F. Hasler, Nov 11 2012
Comments