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.

Showing 1-10 of 12 results. Next

A219055 Number of ways to write n = p+q(3-(-1)^n)/2 with p>q and p, q, p-6, q+6 all prime.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 1, 1, 1, 1, 3, 1, 1, 2, 2, 1, 3, 1, 1, 2, 2, 1, 3, 1, 0, 2, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, 2, 3, 1, 1, 3, 2, 1, 4, 1, 0, 3, 3, 1, 3, 1, 1, 3, 3, 1, 2, 2, 2, 2, 2, 2, 3, 1, 3, 3, 1, 2, 6, 1, 2, 2, 1, 3, 5, 0, 1, 4, 2, 1, 4, 0, 1, 4, 3
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 11 2012

Keywords

Comments

Conjecture: a(n) > 0 for all even n > 8012 and odd n > 15727.
This implies Goldbach's conjecture, Lemoine's conjecture and the conjecture that there are infinitely many primes p with p+6 also prime.
It has been verified for n up to 10^8.
Zhi-Wei Sun also made the following general conjecture: For any two multiples d_1 and d_2 of 6, all sufficiently large integers n can be written as p+q(3-(-1)^n)/2 with p>q and p, q, p-d_1, q+d_2 all prime. For example, for (d_1,d_2) = (-6,6),(-6,-6),(6,-6),(12,6),(-12,-6), it suffices to require that n is greater than 15721, 15733, 15739, 16349, 16349 respectively.

Examples

			a(18) = 2 since 18 = 5+13 = 7+11 with 5+6, 13-6, 7+6, 11-6 all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[Prime[k]+6]==True&&PrimeQ[n-(1+Mod[n,2])Prime[k]]==True&&PrimeQ[n-(1+Mod[n,2])Prime[k]-6]==True,1,0],{k,1,PrimePi[(n-1)/(2+Mod[n,2])]}]
    Do[Print[n," ",a[n]],{n,1,100000}]
  • PARI
    A219055(n)={my(c=1+bittest(n, 0), s=0); forprime(q=1, (n-1)\(c+1), isprime(q+6) && isprime(n-c*q) && isprime(n-c*q-6) && s++); s} \\ M. F. Hasler, Nov 11 2012

A218825 Number of ways to write 2n-1 as p+2q with p, q and p^2+60q^2 all prime.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 1, 3, 1, 3, 3, 1, 2, 2, 1, 2, 3, 1, 2, 3, 1, 2, 2, 1, 3, 1, 1, 3, 3, 4, 3, 1, 2, 5, 3, 1, 3, 2, 4, 3, 3, 1, 7, 4, 1, 5, 3, 5, 8, 4, 3, 4, 3, 3, 5, 4, 4, 3, 2, 3, 5, 3, 5, 7, 3, 2, 9, 4, 4, 6, 3, 3, 8, 6, 1, 4, 5, 2, 7, 1, 4, 2, 4, 5, 5, 2, 4, 4, 3, 2, 5, 4, 5, 6, 4, 1
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 07 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>8.
This conjecture is stronger than Lemoine's conjecture. It has been verified for n up to 10^8.
Conjecture verified for 2n-1 up to 10^9. - Mauro Fiorentini, Jul 20 2023
Zhi-Wei Sun also made the following general conjecture: For any positive integer n, the set E(n) of positive odd integers not of the form p+2q with p, q, p^2+4(2^n-1)q^2 all prime, is finite. In particular, if we let M(n) denote the maximal element of E(n), then M(1)=3449, M(2)=1711, E(3)={1,3,5,7,31,73}, E(4)={1,3,5,7,9,11,13,15},
M(5)=6227, M(6)=1051, M(7)=2239, M(8)=2599, M(9)=7723,
M(10)=781, M(11)=1163, M(12)=587, M(13)=11443,
M(14)=2279, M(15)=157, M(16)=587, M(17)=32041,
M(18)=1051, M(19)=2083, M(20)=4681.
Conjecture verified for 2n-1 up to 10^9 for n <= 4 and up to 10^6 for n <= 20. - Mauro Fiorentini, Jul 20 2023
Zhi-Wei Sun also guessed that for any positive even integer d not congruent to 2 modulo 6 there exists a prime p(d) such that for any prime p>p(d) there is a prime q

p(4)=p(6)=3, p(10)=5, p(12)=3, p(16)=2, p(18)=3,
p(22)=11, p(24)=17, and p(28)=p(30)=7.

Examples

			a(10)=1 since the only primes p and q with p^2+60q^2 prime and p+2q=19 are p=13 and q=3.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[q]==True&&PrimeQ[2n-1-2q]==True&&PrimeQ[(2n-1-2q)^2+60q^2]==True,1,0],{q,1,n-1}]
    Do[Print[n," ",a[n]],{n,1,20000}]
  • PARI
    A218825(n)={my(c=0,n21=n*2-1);forprime(q=2,n-1,isprime(n21-2*q) || next; isprime(q^2*60+(n21-2*q)^2) && c++); c}  \\ M. F. Hasler, Nov 07 2012

A218867 Number of prime pairs {p,q} with p>q and {p-4,q+4} also prime such that p+(1+(n mod 6))q=n if n is not congruent to 4 (mod 6), and p-q=n and q

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 2, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 0, 1, 2, 2, 2, 2, 0, 2, 2, 1, 1, 1, 2, 1, 0, 0, 1, 0, 2, 2, 0, 2, 1, 3, 0, 1, 1, 2, 2, 1, 0, 3, 2, 3, 0, 2, 1, 4, 1, 1, 2, 1, 3, 2
Offset: 1

Author

Zhi-Wei Sun, Nov 13 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>50000 with n different from 50627, 61127, 66503.
This conjecture implies that there are infinitely many cousin prime pairs. It is similar to the conjectures related to A219157 and A219055.

Examples

			a(20)=1 since 20=11+3*3 with 11-4 and 3+4 prime. a(28)=1 since 28=41-13 with 41-4 and 13+4 prime.
		

Programs

  • Mathematica
    c[n_]:=c[n]=If[Mod[n+2,6]==0,1,-1-Mod[n,6]]; d[n_]:=d[n]=2+If[Mod[n+2,6]>0,Mod[n,6],0]; a[n_]:=a[n]=Sum[If[PrimeQ[Prime[k]+4] == True && PrimeQ[n+c[n]Prime[k]] == True && PrimeQ[n+c[n]Prime[k]-4]==True,1,0], {k,1,PrimePi[(n-1)/d[n]]}]; Do[Print[n," ",a[n]], {n,100}]

A219157 Number of prime pairs {p,q} with p>q and p-2,q+2 also prime such that p+(1+mod(-n,6))q=n if n is not congruent to 2 mod 6, and p-q=n and q

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 0, 2, 0, 2, 2, 1, 1, 2, 3, 1, 0, 2, 1, 1, 0, 2, 2, 1, 2, 1, 2, 1, 0, 1, 0, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 2, 2, 0, 1, 3, 1, 0
Offset: 1

Author

Zhi-Wei Sun, Nov 12 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>30000 with n different from 38451, 46441, 50671, 62371.
This conjecture is stronger than the twin prime conjecture. It is similar to the conjecture associated with A219055 about sexy prime pairs.

Examples

			a(16)=1 since 16=7+3*3 with 7-2 and 3+2 prime. a(26)=1 since 26=31-5 with 31-2 and 5+2 prime.
		

Programs

  • Mathematica
    c[n_]:=c[n]=If[Mod[n-2,6]==0,1,-1-Mod[-n,6]]
    d[n_]:=d[n]=2+If[Mod[n-2,6]>0,Mod[-n,6],0]
    a[n_]:=a[n]=Sum[If[PrimeQ[Prime[k]+2]==True&&PrimeQ[n+c[n]Prime[k]]==True&&PrimeQ[n+c[n]Prime[k]-2]==True,1,0],
    {k,1,PrimePi[(n-1)/d[n]]}]
    Do[Print[n," ",a[n]],{n,1,100000}]

A219185 Number of prime pairs {p,q} (p>q) with 3(p-q)-1 and 3(p-q)+1 both prime such that p+(1+(n mod 2))q=n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 1, 1, 2, 1, 0, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1, 2, 0, 1, 2, 2, 0, 2, 2, 0, 2, 1, 0, 3, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 4, 1, 1, 1, 0, 1, 1, 2, 1, 1, 3, 1, 5, 2, 1, 2, 1, 0, 2, 0, 2, 3, 4, 2, 3, 3, 2, 2, 1, 3, 2, 1, 1, 2, 0, 0, 2, 1, 3, 2, 3
Offset: 1

Author

Zhi-Wei Sun, Nov 13 2012

Keywords

Comments

Conjecture: a(n)>0 for all odd n>4676 and even n>30986.
This conjecture has been verified for n up to 5*10^7. It implies Goldbach's conjecture, Lemoine's conjecture and the twin prime conjecture.

Examples

			a(11)=1 since 11=5+2*3, and both 3(5-3)-1=5 and 3(5-3)+1=7 are prime.
a(16)=2 since 16=11+5=13+3, and 3(11-5)-1, 3(11-5)+1, 3(13-3)-1, 3(13-3)+1 are all prime.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[n-(1+Mod[n,2])Prime[k]]==True&&PrimeQ[3(n-(2+Mod[n,2])Prime[k])-1]==True&&PrimeQ[3(n-(2+Mod[n,2])Prime[k])+1]==True,1,0],
    {k,1,PrimePi[(n-1)/(2+Mod[n,2])]}]
    Do[Print[n," ",a[n]],{n,1,100000}]
  • PARI
    a(n)=if(n%2, aOdd(n), aEven(n))
    aOdd(n)=my(s); forprime(q=2,(n-1)\3, my(p=n-2*q); if(isprime(n-2*q) && isprime(3*n-9*q-1) && isprime(3*n-9*q+1), s++)); s
    aEven(n)=my(s); forprime(q=2,n/2, if(isprime(n-q) && isprime(3*n-6*q-1) && isprime(3*n-6*q+1), s++)); s
    \\ Charles R Greathouse IV, Jul 31 2016

A219052 Number of ways to write n = p + q(3 - (-1)^n)/2 with q <= n/2 and p, q, p^2 + q^2 - 1 all prime.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 2, 1, 1, 0, 2, 2, 0, 2, 1, 0, 0, 1, 1, 3, 0, 1, 1, 1, 1, 3, 1, 1, 4, 0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 4, 0, 0, 3, 0, 1, 2, 2, 1, 3, 1, 2, 3, 2, 1, 3, 2, 4, 2, 1, 2, 1, 1, 0, 4, 2, 1, 1, 1, 2, 5, 4, 1, 3, 1, 1, 4, 1, 1, 2, 2
Offset: 1

Author

Zhi-Wei Sun, Nov 10 2012

Keywords

Comments

Conjecture: a(n) > 0 for all n > 784.
This conjecture implies Goldbach's conjecture, Lemoine's conjecture, and that there are infinitely many primes of the form p^2 + q^2 - 1 with p and q both prime.
It has been verified for n up to 10^8.
Zhi-Wei Sun also made the following general conjecture: Let d be any odd integer not congruent to 1 modulo 3. Then, all large even numbers can be written as p + q with p, q, p^2 + q^2 + d all prime. If d is also not divisible by 5, then all large odd numbers can be represented as p + 2q with p, q, p^2 + q^2 + d all prime.

Examples

			a(12) = 1 since {5, 7} is the only prime pair {p, q} for which  p + q = 12, and p^2 + q^2 - 1 is prime.
		

Programs

  • Mathematica
    a[n_] := a[n] = Sum[If[PrimeQ[n - (1 + Mod[n, 2])Prime[k]] == True && PrimeQ[Prime[k]^2 + (n - (1 + Mod[n, 2])Prime[k])^2 - 1] == True, 1, 0], {k, 1, PrimePi[n/2]}]; Do[Print[n, " ", a[n]], {n, 1, 20000}]

A227909 Number of ways to write 2*n = p + q with p, q and (p-1)*(q+1) - 1 all prime.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 3, 3, 1, 2, 5, 2, 3, 2, 3, 3, 5, 3, 1, 5, 4, 5, 4, 3, 4, 7, 4, 4, 2, 1, 4, 9, 2, 4, 11, 4, 2, 6, 2, 6, 11, 6, 4, 3, 3, 5, 6, 4, 3, 6, 2, 4, 10, 3, 10, 12, 7, 1, 6, 6, 5, 11, 4, 5, 6, 4, 3, 11, 2, 10, 13, 4, 6, 5, 2, 14, 13, 2, 2, 5, 5, 9, 15, 5, 3, 7, 8, 5, 3, 5, 7, 15, 3, 1, 8, 5, 7, 11, 4
Offset: 1

Author

Olivier Gérard and Zhi-Wei Sun, Oct 13 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
This is stronger than Goldbach's conjecture for even numbers. It also implies A. Murthy's conjecture (cf. A109909) for even numbers.
We have verified the conjecture for n up to 2*10^7.
Conjecture verified for n up to 10^9. - Mauro Fiorentini, Jul 26 2023

Examples

			a(6) = 1 since 2*6 = 5 + 7, and (5-1)*(7+1)-1 = 31 is prime.
a(10) = 1 since 2*10 = 7 + 13, and (7-1)*(13+1)-1 = 83 is prime.
a(20) = 1 since 2*20 = 17 + 23, and (17-1)*(23+1)-1 = 383 is prime.
		

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[2n-Prime[i]]&&PrimeQ[(Prime[i]-1)(2n-Prime[i]+1)-1],1,0],{i,1,PrimePi[2n-2]}]
    Table[a[n],{n,1,100}]

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

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

A219026 Number of primes p<=n such that 2n-p and 2n+p-2 are both prime.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 1, 2, 1, 0, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 0, 3, 1, 2, 2, 1, 2, 3, 1, 1, 3, 2, 2, 3, 3, 3, 3, 3, 1, 3, 1, 3, 2, 2, 2, 3, 4, 1, 4, 2, 2, 5, 1, 2, 4, 0, 3, 2, 3, 3, 2, 2, 1, 3, 3, 4, 4, 2, 3, 5, 3, 4, 3, 2, 3, 4, 3, 1, 3, 4, 3, 4, 3, 5, 4, 3, 3, 2, 3, 3, 3, 4, 2, 6, 3, 2, 7, 4, 2
Offset: 1

Author

Zhi-Wei Sun, Nov 10 2012

Keywords

Comments

Conjecture: a(n)>0 except for n=1,2,4,6,10,22,57.
This is stronger than the Goldbach conjecture; it has been verified for n up to 5*10^7.
Zhi-Wei Sun also conjectured that if n is not among 1,2,3,5,8,87,108 then there is a prime p in (n,2n)
such that 2n-p and 2n+p-2 are both prime. For conjectures in Section 2 of arXiv:1211.1588, he had similar conjectures with p<=n replaced by p in (n,2n)
For example, if n is not among 1,2,4,6,10,15 then there is a prime p in (n,2n) such that
2n-p and 2n+p+2 are both prime.

Examples

			a(8)=2 since 3 and 5 are the only primes p<=8 with 16-p and 14+p both prime.
		

Programs

A218797 Number of ways to write 2n - 1 as p + q + r with p <= q <= r and p, q, r, p^2 + q^2 + r^2 all prime.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 1, 2, 0, 1, 2, 2, 1, 3, 2, 3, 1, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 4, 1, 3, 2, 2, 2, 2, 2, 2, 4, 3, 3, 3, 2, 4, 4, 3, 0, 2, 1, 1, 1, 1, 2, 2, 3, 2, 4, 4, 3, 3, 2, 3, 4, 2, 2, 3, 2, 1, 3, 3, 1, 2, 2, 5, 1, 4, 2, 2, 1, 1, 6, 3, 1, 5, 1, 1, 5, 4, 1, 4, 1, 2, 6, 2, 4, 2, 2, 2, 1, 4, 4
Offset: 1

Author

Zhi-Wei Sun, Nov 05 2012

Keywords

Comments

Conjecture: a(n) > 0 for all n=1715,1716,....
This conjecture is stronger than the weak Goldbach conjecture. It has been verified for n up to 500,000. Those 0

Examples

			a(7)=2 since 13=3+3+7=3+5+5, and both 3^2+3^2+7^2=67 and 3^2+5^2+5^2=59 are primes.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[n-Prime[j]-Prime[k]]==True&&PrimeQ[Prime[j]^2+Prime[k]^2+(n-Prime[j]-Prime[k])^2]==True,1,0],{j,1,PrimePi[n/3]},{k,j,PrimePi[(n-Prime[j])/2]}]
    Do[Print[n," ",a[2n-1]],{n,1,10000}]
Showing 1-10 of 12 results. Next