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-9 of 9 results.

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

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

Views

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.
		

Crossrefs

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

Views

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.
		

Crossrefs

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

Views

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.
		

Crossrefs

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

Views

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.
		

Crossrefs

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}]

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

Views

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.
		

Crossrefs

Programs

A219025 Number of primes p

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 10 2012

Keywords

Comments

Conjecture: a(n)>0 for all n=6,7,...
This has been verified for n up to 10^8.
Zhi-Wei Sun also made the following general conjecture:
Let P(x) be any non-constant integer-valued polynomial with positive leading coefficient. If n is large enough, then there is a prime p
See also A219023 for similar conjectures.

Examples

			a(11)=2 since the 5 and 7 are the only primes p<11 with 66-p and 66+p both prime.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[6n-Prime[k]]==True&&PrimeQ[6n+Prime[k]]==True,1,0],{k,1,PrimePi[n-1]}]
    Do[Print[n," ",a[n]],{n,1,20000}]

A219558 Number of odd prime pairs {p,q} (p>q) such that p+(1+(n mod 2))q=n and ((p-1-(n mod 2))/q)=((q+1)/p)=1 where (-) denotes the Legendre symbol.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Nov 23 2012

Keywords

Comments

For any integer m, define s(m) as the smallest positive integer s such that for each n=s,s+1,... there are primes p>q>2 with p+(1+(n mod 2))q=n and ((p-(1+(n mod 2))m)/q)=((q+m)/p)=1. If such a positive integer s does not exist, then we set s(m)=0.
Zhi-Wei Sun has the following general conjecture: s(m) is always positive. In particular, s(0)=1239,
s(1)=1470, s(-1)=2192, s(2)=1034, s(-2)=1292,
s(3)=1698, s(-3)=1788, s(4)=848, s(-4)=1458,
s(5)=1490, s(-5)=2558, s(6)=1115, s(-6)=1572,
s(7)=1550, s(-7)=932, s(8)=825, s(-8)=2132,
s(9)=1154, s(-9)=1968, s(10)=1880, s(-10)=1305,
s(11)=1052, s(-11)=1230, s(12)=2340, s(-12)=1428,
s(13)=2492, s(-13)=2673, s(14)=1412, s(-14)=1638,
s(15)=1185, s(-15)=1230, s(16)=978, s(-16)=1605,
s(17)=1154, s(-17)=1692, s(18)=1757, s(-18)=2292,
s(19)=1230, s(-19)=2187, s(20)=2048, s(-20)=1372,
s(21)=1934, s(-21)=1890, s(22)=1440, s(-22)=1034,
s(23)=1964, s(-23)=1322, s(24)=1428, s(-24)=2042,
s(25)=1734, s(-25)=1214, s(26)=1260, s(-26)=1230,
s(27)=1680, s(-27)=1154, s(28)=1652, s(-28)=1808,
s(29)=1112, s(-29)=1670, s(30)=1820, s(-30)=1284.
Note that s(1)=1470 means that a(n)>0 for all n=1470,1471,... That s(0)=1239 is related to a conjecture of Olivier Gérard and Zhi-Wei Sun.
If we replace ((p-1-(n mod 2))/q)=((q+1)/p)=1 in the definition of a(n) by ((p-1)/q)=((q+1)/p)=1, then the new a(n) seems positive for any n>1181.

Examples

			a(14)=1 since 14=11+3 with ((11-1)/3)=((3+1)/11)=1.
a(31)=1 since 31=17+2*7 with ((17-2)/7)=((7+1)/17)=1.
		

Programs

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

A218830 Largest odd integer not of the form p+2q with p, q, p^2+4(2^n-1)q^2 all prime, or 0 if there would be no such upper bound.

Original entry on oeis.org

3449, 1711, 73, 15, 6227, 1051, 2239, 2599, 7723, 781, 1163, 587, 11443, 2279, 157, 587, 32041, 1051, 2083, 4681
Offset: 1

Author

Zhi-Wei Sun and M. F. Hasler, Nov 07 2012

Keywords

Comments

This is the sequence M defined in a comment to A218825.
Zhi-Wei Sun has conjectured (Nov 07 2012) that for any n>0, there is only a finite number of positive odd integers not of the given form. See arXiv:1211.1588.

Examples

			The exceptionally low values a(3), a(4) and a(15) correspond to the sets:
E(3) = {1,3,5,7,31,73} = { 2n-1: for no prime q, both p=2n-1-2q and p^2+28*q^2 are prime },
E(4) = {1,3,5,7,9,11,13,15} = { 2n-1: A218825(n)=0 },
E(15) = {1,3,5,7,9,13,15,31,33,35,37,73,89,157} = { 2n-1: for no prime q, both p=2n-1-2q and p^2+4(2^15-1)q^2 are prime }.
		

Crossrefs

Showing 1-9 of 9 results.