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 41 results. Next

A219864 Number of ways to write n as p+q with p and 2pq+1 both prime.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 0, 2, 4, 2, 2, 4, 1, 2, 6, 3, 1, 2, 2, 5, 3, 1, 1, 7, 2, 6, 3, 1, 6, 8, 2, 2, 5, 3, 3, 8, 2, 4, 6, 3, 4, 4, 1, 3, 7, 2, 3, 7, 3, 6, 8, 2, 1, 12, 5, 4, 7, 4, 7, 7, 7, 5, 4, 4, 6, 9, 2, 2, 13, 2, 5, 7, 2, 4, 18, 6, 3, 5, 6, 5, 8, 4, 2, 9, 4, 10, 5, 2, 5, 17, 3, 3, 7, 7, 5, 8, 3, 3, 17, 8
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 30 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>7.
This has been verified for n up to 3*10^8.
Zhi-Wei Sun also made the following general conjecture: For each odd integer m not congruent to 5 modulo 6, any sufficiently large integer n can be written as p+q with p and 2*p*q+m both prime.
For example, when m = 3, -3, 7, 9, -9, -11, 13, 15, it suffices to require that n is greater than 1, 29, 16, 224, 29, 5, 10, 52 respectively.
Sun also guessed that any integer n>4190 can be written as p+q with p, 2*p*q+1, 2*p*q+7 all prime, and any even number n>1558 can be written as p+q with p, q, 2*p*q+3 all prime. He has some other similar observations.

Examples

			a(10)=2 since 10=3+7=7+3 with 2*3*7+1=43 prime.
a(263)=1 since 83 is the only prime p with 2p(263-p)+1 prime.
		

Crossrefs

Programs

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

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

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 04 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>=1188.
Conjecture verified for n up to 10^9. - Mauro Fiorentini, Sep 23 2023
This conjecture is stronger than both Goldbach's conjecture and Lemoine's conjecture.
Zhi-Wei Sun also made the following conjecture: Given any positive odd integer d, there is a prime p(d) such that for any prime p>p(d) there is a prime q

Conjecture verified for d up to 100 and p up to 10^7. - Mauro Fiorentini, Sep 23 2023

Examples

			For n=72 we have a(72)=1 since the only primes p and q with p+q=72, q<=36 and p^2+3pq+q^2 prime are p=67 and q=5.
		

Crossrefs

Cf. A000034 = 1,2,1,2,... = (3-(-1)^n)/2. (Note: Offset shifted w.r.t. use in the definition of this sequence.) - M. F. Hasler, Nov 05 2012

Programs

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

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

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

A209315 Number of ways to write 2n-1 = p+q with q practical, p and q-p both prime.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Jan 19 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>8.
This has been verified for n up to 10^7.
As p+q=2p+(q-p), the conjecture implies Lemoine's conjecture related to A046927.
Zhi-Wei Sun also conjectured that any integer n>2 can be written as p+q, where p is a prime, one of q and q+1 is prime and another of q and q+1 is practical.

Examples

			a(9)=1 since 2*9-1=5+12 with 12 practical, 5 and 12-5 both prime.
		

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n]
    Pow[n_, i_]:=Pow[n, i]=Part[Part[f[n], i], 1]^(Part[Part[f[n], i], 2])
    Con[n_]:=Con[n]=Sum[If[Part[Part[f[n], s+1], 1]<=DivisorSigma[1, Product[Pow[n, i], {i, 1, s}]]+1, 0, 1], {s, 1, Length[f[n]]-1}]
    pr[n_]:=pr[n]=n>0&&(n<3||Mod[n, 2]+Con[n]==0)
    a[n_]:=a[n]=Sum[If[PrimeQ[p]==True&&pr[2n-1-p]==True&&PrimeQ[2n-1-2p]==True,1,0],{p,1,n-1}]
    Do[Print[n," ",a[n]],{n,1,100}]

A235189 Number of ways to write n = (1 + (n mod 2))*p + q with p < n/2 such that p, q and prime(p) - p + 1 are all prime.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Jan 04 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 6.
This implies both Goldbach's conjecture (A045917) and Lemoine's conjecture (A046927). For primes p with prime(p) - p + 1 also prime, see A234695.

Examples

			a(10) = 1 since 10 = 3 + 7 with 3, 7 and prime(3) - 3 + 1 = 3 all prime.
a(28) = 1 since 28 = 5 + 23 with 5, 23 and prime(5) - 4 = 7 all prime.
a(61) = 1 since 61 = 2*7 + 47 with 7, 47 and prime(7) - 6 = 11 all prime.
a(98) = 1 since 98 = 31 + 67 with 31, 67 and prime(31) - 30 = 97 all prime.
		

Programs

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

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

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Jan 28 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2.
(ii) If n > 30, then 2*n + 1 can be written as 2*p + q with p, q and prime(p + 2) + 2 all prime.
Part (i) implies both the Goldbach conjecture and the twin prime conjecture. If all primes p with prime(p + 2) + 2 are smaller than an even number N > 2, then for any such a prime p the number N! + N - p is in the interval (N!, N! + N) and hence not prime.
Similarly, part (ii) implies both Lemoine's conjecture (cf. A046927) and the twin prime conjecture.
We have verified part (i) of the conjecture for n up to 2*10^8.

Examples

			a(10) = 1 since 2*10 = 3 + 17 with 3, 17 and prime(3 + 2) + 2 = 11 + 2 = 13 all prime.
a(589) = 1 since 2*589 = 577 + 601 with 577, 601 and prime(577 + 2) + 2 = 4229 + 2 = 4231 all prime.
		

Programs

  • Mathematica
    p[m_]:=PrimeQ[Prime[m+2]+2]
    a[n_]:=Sum[If[p[Prime[k]]&&PrimeQ[2n-Prime[k]],1,0],{k,1,PrimePi[2n-1]}]
    Table[a[n],{n,1,100}]
Showing 1-10 of 41 results. Next