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.

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

Views

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.
		

Crossrefs

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

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 19 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>2.
As p+q=(p+1)+(q-1), this unifies Goldbach's conjecture and its analog involving practical numbers.
The conjecture has been verified for n up to 10^7.

Examples

			a(8) = 2 since 2*8 = 3+13 = 11+5 with 3, 5, 11, 13 all prime and 3+1, 13-1, 11+1, 5-1 all practical.
		

Crossrefs

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[2n-Prime[k]]==True&&pr[Prime[k]+1]==True&&pr[2n-Prime[k]-1]==True,1,0],{k,1,PrimePi[2n-2]}]
    Do[Print[n," ",a[n]],{n,1,100}]

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

A210445 Least positive integer k with k*n practical.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 4, 1, 2, 2, 6, 1, 6, 2, 2, 1, 12, 1, 12, 1, 2, 3, 12, 1, 4, 3, 2, 1, 12, 1, 16, 1, 2, 6, 4, 1, 18, 6, 2, 1, 20, 1, 20, 2, 2, 6, 24, 1, 4, 2, 4, 2, 24, 1, 4, 1, 4, 6, 24, 1, 24, 8, 2, 1, 4, 1, 30, 3, 4, 2, 30, 1, 30, 9, 2, 3, 4, 1, 36, 1, 2, 10, 36, 1, 4, 10, 4, 1, 36, 1, 4, 3, 6, 12, 4, 1, 42, 2, 2, 1
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 20 2013

Keywords

Comments

Conjecture: a(n) < n for all n>1, and a(n) < n/2 for all n>47.
Large values are obtained for prime n: The corresponding subsequence is a(p(n)) = (1, 2, 4, 4, 6, 6, 12, 12, 12, 12, 16, 18, 20, 20, 24, 24, 24, 24, ...), while for composite indices, a(c(n)) = (1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 3, 1, 4, 3, 2, 1, 1, 1, 2, ...). - M. F. Hasler, Jan 21 2013

Examples

			a(10)=2 since 2*10=20 is practical but 1*10=10 is not.
		

Crossrefs

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)
    Do[Do[If[pr[k*n]==True,Print[n," ",k];Goto[aa]],{k,1,n}];
    Print[n," ",counterexample];Label[aa];Continue,{n,1,100}]
  • PARI
    A210445(n)={for(k=1,n,is_A005153(k*n)&&return(k))} \\ (Would return 0 if a(n)>n.) - M. F. Hasler, Jan 20 2013

Formula

a(n) = 1 iff n is in A005153, therefore a(n) > 1 for all odd n>1. - M. F. Hasler, Jan 21 2013

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

A210444 a(n) = |{0

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Jan 20 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>911.
This implies that for each n=2,3,4,... there is a positive integer k
The conjecture has been verified for n up to 10^6.

Examples

			a(7) = 1 since 6*7 = 42 is practical, and 41 and 43 are twin primes.
		

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[k*n-1]==True&&PrimeQ[k*n+1]==True&&pr[k*n]==True,1,0],{k,1,n-1}]
    Do[Print[n," ",a[n]],{n,1,100}]

A210452 Number of integers k

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Jan 20 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>4.
This implies the twin prime conjecture since k*p is not practical for any prime p>sigma(k)+1.
Zhi-Wei Sun also made the following conjectures:
(1) For each integer n>197, there is a practical number k
(2) For every n=9,10,... there is a practical number k
(3) For any integer n>26863, the interval [1,n] contains five consecutive integers m-2, m-1, m, m+1, m+2 with m-1 and m+1 both prime, and m-2, m, m+2, m*n all practical.

Examples

			a(11)=1 since 5 and 7 are twin primes, and 6 and 6*11 are both practical.
		

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[k-1]==True&&PrimeQ[k+1]==True&&pr[k]==True&&pr[k*n]==True,1,0],{k,1,n-1}]
    Do[Print[n," ",a[n]],{n,1,100}]

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.