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.

A091182 Number of ways to write n = x + y (x >= y > 0) with xy - 1 and xy + 1 both prime.

Original entry on oeis.org

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

Views

Author

Ray Chandler, Dec 27 2003

Keywords

Comments

From Zhi-Wei Sun, Nov 27 2012: (Start)
Conjecture: a(n) > 0 for all n > 3120. This has been verified for n up to 5*10^7.
Note that if x >= y > 0 and x+y = n then n-1 = x+y-1 <= xy <= ((x+y)/2)^2 = n^2/4. So the conjecture implies that there are infinitely many twin primes.
For n=4,5,...,3120 we can write n = x+y (x >= y > 0) with xy-1 prime.
For each positive integer n <= 3120 different from 1,6,30,54, we can write n = x+y (x >= y > 0) with xy+1 prime.
More generally, we have the following conjecture: Let m be any positive integer. If n is sufficiently large and (m-1)n is even, then we can write n as x+y, where x and y are positive integers with xy-m and xy+m both prime. This general conjecture implies that for any positive even integer d there are infinitely many primes p and q with difference d. (End)
Sequence A090695 lists the 61 known values of n where a(n) = 0. - T. D. Noe, Nov 29 2012

Examples

			a(8)=1 since 8=6+2 with 6*2-1 and 6*2+1 both prime.
a(11)=2 since 11=6+5=9+2 with 6*5-1, 6*5+1, 9*2-1, 9*2+1 all prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory); a:=n->sum( (pi((i)*(n-i)+1) - pi((i)*(n-i)))*(pi((i)*(n-i)-1) - pi((i)*(n-i) - 2)) , i=1..floor(n/2) ); seq(a(k),k=1..100); # Wesley Ivan Hurt, Jan 21 2013
  • Mathematica
    Table[cnt = 0; Do[If[PrimeQ[k*(n - k) - 1] && PrimeQ[k*(n - k) + 1], cnt++], {k, n/2}]; cnt, {n, 100}] (* Zhi-Wei Sun, edited by T. D. Noe, Nov 29 2012 *)

Extensions

Edited by N. J. A. Sloane, Nov 29 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}]

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

A187757 Number of ways to write n=x+y (x,y>0) with 6x-1, 6x+1, 6y+1 and 6y+5 all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 03 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>1.
This has been verified for n up to 10^9. It implies that there are infinitely many twin primes and also infinitely many cousin primes, since the interval [m!+2,m!+m] of length m-2 contains no prime for any integer m>1.

Examples

			a(92)=1 since 92=40+52 with 6*40-1, 6*40+1, 6*52+1 and 6*52+5 all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[6k-1]==True&&PrimeQ[6k+1]==True&&PrimeQ[6(n-k)+1]==True&&PrimeQ[6(n-k)+5]==True,1,0],{k,1,n-1}]
    Do[Print[n," ",a[n]],{n,1,100}]

A187759 Number of ways to write n=x+y (0

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 03 2013

Keywords

Comments

Conjecture: If n>200 is not among 211, 226, 541, 701, then a(n)>0.
This essentially follows from the conjecture related to A219157, since n=x+y for some positive integers x and y with 6x-1,6x+1,6y-1,6y+1 all prime if and only if 6n=p+q for some twin prime pairs {p,p-2} and {q,q+2}.
Similarly, the conjecture related to A218867 implies that any integer n>491 can be written as x+y (0A219055 implies that any integer n>1600 not among 2729 and 4006 can be written as x+y (0

Examples

			a(9)=1 since 9=2+7 with 6*2-1, 6*2+1, 6*7-1 and 6*7+1 all prime.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[6k-1]==True&&PrimeQ[6k+1]==True&&PrimeQ[6(n-k)-1]==True&&PrimeQ[6(n-k)+1]==True,1,0],{k,1,(n-1)/2}]
    Do[Print[n," ",a[n]],{n,1,100}]
  • PARI
    a(n)=sum(x=1,(n-1)\2,isprime(6*x-1)&&isprime(6*x+1)&&isprime(6*n-6*x-1)&&isprime(6*n-6*x+1)) \\ Charles R Greathouse IV, Feb 28 2013

A187785 Number of ways to write n=x+y (x,y>=0) with {6x-1,6x+1} a twin prime pair and y a triangular number.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Jan 06 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>48624 not equal to 76106.
We have verified this for n up to 2*10^8. It seems that 723662 is the unique n>76106 which really needs y=0 in the described representation.
Compare the conjecture with another Sun's conjecture associated with A132399.

Examples

			a(9)=1 since 9=3+3(3+1)/2 with 6*3-1 and 6*3+1 both prime.
		

References

  • Zhi-Wei Sun, On sums of primes and triangular numbers, J. Comb. Number Theory 1(2009), no. 1, 65-76.

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[6(n-k(k+1)/2)-1]==True&&PrimeQ[6(n-k(k+1)/2)+1]==True,1,0],{k,0,(Sqrt[8n+1]-1)/2}]
    Do[Print[n," ",a[n]],{n,1,100}]

A187754 Number of ways of writing the n-th twin prime p as p = q + r + s, where q >= r >= s are twin primes.

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 3, 6, 5, 8, 7, 7, 8, 8, 9, 10, 12, 14, 13, 15, 14, 21, 20, 20, 22, 22, 23, 23, 24, 36, 34, 36, 38, 42, 44, 43, 44, 51, 53, 59, 56, 48, 53, 57, 58, 57, 60, 75, 78, 87, 87, 78, 79, 67, 65
Offset: 1

Author

Fabio Mercurio, Jan 03 2013

Keywords

Comments

The author conjectures that a(n) >= 1 for all n >= 4.
By Zhi-Wei Sun's conjecture related to A219157, for any positive integer n not among 1, 10, 430 we can write 6n-1 = p+2q = p+q+q with p,p-2,q,q+2 all prime, also for any integer n>702 we can write 6n+1 = 6(n-1)+7 = p+q+7 with p,p-2,q,q+2 all prime. Thus the author's conjecture is a consequence of Sun's conjecture. - Zhi-Wei Sun, Jan 06 2013

Examples

			a(9) = 5 because the ninth twin prime, A001097(9), is 31, and 31 can be written as a sum of three twin primes in 5 distinct ways: 3+11+17, 5+7+19, 5+13+13, 7+7+17, and 7+11+13.
		

Crossrefs

Cf. A001097.

Programs

  • PARI
    isA001097(n) = (isprime(n) & (isprime(n+2) || isprime(n-2)))
    A187754(n) = {local(q, r, s, a); a=0; for( q=1, n, if( isA001097(q), for( r=1, q, if( isA001097(r), for( s=1, r, if( isA001097(s) && (n==q+r+s), a=a+1)))))); a}
    n=1; for( p=1, 700, if( isA001097(p), print(n, " ", A187754(p)); n=n+1)) /* Michael B. Porter, Jan 05 2013 */

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

A220091 Number of ways to write n=p+q+(n mod 2)q with p>q and p, q, 6q-1, 6q+1 all prime.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Dec 04 2012

Keywords

Comments

Conjecture: a(n)>0 for all even n>=8070 and odd n>=18680.
This conjecture unifies the twin prime conjecture, Goldbach's conjecture and Lemoine's conjecture. It has been verified for n up to 10^7.
Zhi-Wei Sun also made the following conjecture: Any integer n>=6782 can be written as p+q+(n mod 2)q with p>q and p, q, q-6, q+6 all prime, and any integer n>=4410 can be written as p+q+(n mod 2)q with p>q and p, q, 2q-3, 2q+3 all prime, and any integer n>=16140 can be written as p+q+(n mod 2)q with p>q and p, q, 3q-2, 3q+2 all prime.

Examples

			a(31)=1 since 31=17+2*7 with 6*7-1 and 6*7+1 twin primes.
a(32)=1 since 32=29+3 with 6*3-1 and 6*3+1 twin primes.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[6Prime[k]-1]==True&&PrimeQ[6Prime[k]+1]==True&&PrimeQ[n-(1+Mod[n,2])Prime[k]]==True,1,0],{k,1,PrimePi[(n-1)/(2+Mod[n,2])]}]
    Do[Print[n," ",a[n]],{n,1,100}]
Showing 1-9 of 9 results.