cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A218771 Primes of the form p^2 + 3pq + q^2 with p and q prime.

Original entry on oeis.org

31, 59, 79, 179, 191, 229, 251, 311, 389, 401, 479, 491, 541, 569, 719, 809, 971, 1019, 1061, 1109, 1151, 1249, 1301, 1409, 1451, 1499, 1619, 1931, 1949, 2111, 2141, 2339, 2591, 2609, 2711, 2801, 2939, 3089, 3371, 3389, 3449, 3881, 4021, 4091, 4211, 4391, 4451, 4679, 5039, 5051
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 05 2012

Keywords

Comments

It is easy to see that a(n) is congruent to 1 or 9 modulo 10. For each n there is a unique pair of primes p < q such that p^2 + 3pq + q^2 = a(n).
This sequence is of particular interest due to Zhi-Wei Sun's surprising conjecture related to A218754. That conjecture implies that this sequence is infinite.

Examples

			a(1)=31 since 2^2 + 3*2*3 + 3^2 = 31 and 2,3,31 are prime.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=IntegerQ[Sqrt[n]]
    i=0; Do[Do[If[SQ[4Prime[n]+5Prime[k]^2] && PrimeQ[(Sqrt[4Prime[n] + 5Prime[k]^2] - 3Prime[k])/2] == True, i=i+1; Print[i," ", Prime[n]]; Goto[aa]], {k,1,PrimePi[Sqrt[Prime[n]/5]]}];
    Label[aa];Continue,{n,1,1000000}]
  • PARI
    list(lim)=my(v=List(),t);forprime(p=2, sqrtint(lim\4), forprime(q=p+1,sqrt(lim-p^2), if(isprime(t=p^2+3*p*q+q^2), listput(v,t), if(t>lim,break)))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Nov 05 2012
    
  • PARI
    is_A218771(n,v=0)={ my(r,c=0); isprime(n) & forprime( q=1,sqrtint(n\5), issquare(4*n+5*q^2, &r) || next; isprime((r-3*q)/2) || next; v || return(1); v>1 & print1([q,(r-3*q)/2]","); c++);c}  \\ - M. F. Hasler, Nov 05 2012