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.

A208243 Number of ways to write 2n-1 = p+q, where p is a prime, and both q and q+2 are practical numbers (A005153).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 11 2013

Keywords

Comments

Conjecture: a(n)>0 for all n=3,4,...
The author has verified this for n up to 2*10^8. It is known that there are infinitely many practical numbers q with q+2 also practical.
Zhi-Wei Sun also made the following similar conjectures:
(1) Each odd number n>5 can be written as p+q with p and p+6 both prime and q practical. Also, any odd number n>3 not equal to 55 can be written as p+q with p and p+2 both prime and q practical.
(2) Each integer n>10 can be written as x+y (x,y>0) with 6x-1 and 6x+1 both prime, and y and y+6 both practical.
Also, any integer n>=6360 can be written as x+y (x,y>0) with 6x-1 and 6x+1 both prime, and y and y+2 both practical.

Examples

			a(14)=2 since 2*14-1=27=11+16=23+4, where 11 and 23 are primes, 16,16+2,4,4+2 are practical numbers.
		

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

A218829 Number of ordered ways to write n = k + m with k > 0 and m > 0 such that prime(k) + 2 and prime(prime(m)) + 2 are both prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 05 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2, and a(n) = 1 only for n = 3, 22, 25, 38, 101, 273.
(ii) Each n = 2, 3, ... can be written as k + m with k > 0 and m > 0 such that 6*k - 1, 6*k + 1 and prime(prime(m)) + 2 are all prime.
(iii) Any integer n > 5 can be written as k + m with k > 0 and m > 0 such that phi(k) - 1, phi(k) + 1 and prime(prime(m)) + 2 are all prime, where phi(.) is Euler's totient function.
(iv) If n > 2 is neither 10 nor 31, then n can be written as k + m with k > 0 and m > 0 such that prime(k) + 2 and prime(prime(prime(m))) + 2 are both prime.
(v) If n > 1 is not equal to 133, then n can be written as k + m with k > 0 and m > 0 such that 6*k - 1, 6*k + 1 and prime(prime(prime(m))) + 2 are all prime.
Clearly, each part of the conjecture implies the twin prime conjecture.
We have verified part (i) for n up to 10^9. See the comments in A237348 for an extension of this part.

Examples

			a(3) = 1 since 3 = 2 + 1 with prime(2) + 2 = 3 + 2 = 5 and prime(prime(1)) + 2 = prime(2) + 2 = 5 both prime.
a(22) = 1 since 22 = 20 + 2 with prime(20) + 2 = 71 + 2 = 73 and prime(prime(2)) + 2 = prime(3) + 2 = 5 + 2 = 7 both prime.
a(25) = 1 since 25 = 2 + 23 with prime(2) + 2 = 3 + 2 = 5 and prime(prime(23)) + 2 = prime(83) + 2 = 431 + 2 = 433 both prime.
a(38) = 1 since 38 = 35 + 3 with prime(35) + 2 = 149 + 2 = 151 and prime(prime(3)) + 2 = prime(5) + 2 = 11 + 2 = 13 both prime.
a(101) = 1 since 101 = 98 + 3 with prime(98) + 2 = 521 + 2 = 523 and prime(prime(3)) + 2 = prime(5) + 2 = 11 + 2 = 13 both prime.
a(273) = 1 since 273 = 2 + 271 with prime(2) + 2 = 3 + 2 = 5 and prime(prime(271)) + 2 = prime(1741) + 2 = 14867 + 2 = 14869 both prime.
		

Crossrefs

Programs

  • Mathematica
    pq[n_]:=PrimeQ[Prime[n]+2]
    PQ[n_]:=PrimeQ[Prime[Prime[n]]+2]
    a[n_]:=Sum[If[pq[k]&&PQ[n-k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,80}]

A236531 a(n) = |{0 < k < n: {6*k -1 , 6*k + 1} and {prime(n-k), prime(n-k) + 2} are both twin prime pairs}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 27 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 2.
(ii) If n > 3 is neither 11 nor 125, then n can be written as k + m with k > 0 and m > 0 such that 6*k - 1, 6*k + 1, prime(m) + 2 and 3*prime(m) - 10 are all prime.
(iii) Any integer n > 458 can be written as p + q with q > 0 such that {p, p + 2} and {prime(q), prime(q) + 2} are both twin prime pairs.
This is much stronger than the twin prime conjecture. We have verified part (i) of the conjecture for n up to 2*10^7.

Examples

			a(11) = 1 since {6*1 - 1, 6*1 + 1} = {5, 7} and {prime(10), prime(10) + 2} = {29, 31} are both twin prime pairs.
a(16) = 1 since {6*3 - 1, 6*3 + 1} = {17, 19} and {prime(13), prime(13) + 2} = {41, 43} are both twin prime pairs.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[6n-1]&&PrimeQ[6n+1]
    q[n_]:=PrimeQ[Prime[n]+2]
    a[n_]:=Sum[If[p[k]&&q[n-k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

A227923 Number of ways to write n = x + y (x, y > 0) such that 6*x-1 is a Sophie Germain prime and {6*y-1, 6*y+1} is a twin prime pair.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 09 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1. Moreover, any integer n > 4 not equal to 13 can be written as x + y with x and y distinct and greater than one such that 6*x-1 is a Sophie Germain prime and {6*y-1, 6*y+1} is a twin prime pair.
(ii) Any integer n > 1 can be written as x + y (x, y > 0) such that 6*x-1 is a Sophie Germain prime, and {6*y+1, 6*y+5} is a cousin prime pair (or {6*y-1, 6*y+5} is a sexy prime pair).
Part (i) of the conjecture implies that there are infinitely many Sophie Germain primes, and also infinitely many twin prime pairs. For example, if all twin primes does not exceed an integer N > 2, and (N+1)!/6 = x + y with 6*x-1 a Sophie Germain prime and {6*y-1, 6*y+1} a twin prime pair, then (N+1)! = (6*x-1) + (6*y+1) with 1 < 6*y+1 < N+1, hence we get a contradiction since (N+1)! - k is composite for every k = 2..N.
We have verified that a(n) > 0 for all n = 2..10^8.
Conjecture verified up to 10^9. - Mauro Fiorentini, Jul 07 2023

Examples

			a(5) = 2 since 5 = 2 + 3 = 4 + 1, and 6*2-1 = 11 and 6*4-1 = 23 are Sophie Germain primes, and {6*3-1, 6*3+1} = {17, 19} and {6*1-1, 6*1+1} = {5,7} are twin prime pairs.
a(28) = 1 since 28 = 5 + 23 with 6*5-1 = 29 a Sophie Germain prime and {6*23-1, 6*23+1} = {137, 139} a twin prime pair.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=PrimeQ[6n-1]&&PrimeQ[12n-1]
    TQ[n_]:=PrimeQ[6n-1]&&PrimeQ[6n+1]
    a[n_]:=Sum[If[SQ[i]&&TQ[n-i],1,0],{i,1,n-1}]
    Table[a[n],{n,1,100}]

A230230 Number of ways to write 2*n = p + q with p, q, 3*p - 10, 3*q + 10 all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 12 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.
This is stronger than Goldbach's conjecture for even numbers. If 2*n = p + q with p, q, 3*p - 10, 3*q + 10 all prime, then 6*n is the sum of the two primes 3*p - 10 and 3*q + 10.
Conjecture verified for 2*n up to 10^9. - Mauro Fiorentini, Jul 08 2023

Examples

			a(5) = 1 since 2*5 = 7 + 3 with 3*7 - 10 = 11 and 3*3 + 10 = 19 both prime.
a(16) = 1 since 2*16 = 13 + 19 with 3*13 - 10 = 29 and 3*19 + 10 = 67 both prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=n>3&&PrimeQ[3n-10]
    SQ[n_]:=PrimeQ[n]&&PrimeQ[3n+10]
    a[n_]:=Sum[If[PQ[Prime[i]]&&SQ[2n-Prime[i]],1,0],{i,1,PrimePi[2n-2]}]
    Table[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

A236968 Number of ordered ways to write n = k + m with k > 0 and m > 0 such that 6*k - 1, 6*k + 1 and k + phi(m) are all prime, where phi(.) is Euler's totient function.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Feb 02 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1. Also, any n > 12 can be written as k + m (k > 0 and m > 2) with 6*k - 1, 6*k + 1 and k + phi(m)/2 all prime.
(ii) Each integer n > 34 can be written as p + q (q > 0) with p and p + phi(q) both prime. Also, any integer n > 14 can be written as p + q (q > 2) with p, p + 6 and p + phi(q)/2 all prime.
Clearly, part (i) of the conjecture implies that any integer n > 1 can be written as p + m - phi(m), where p is a prime and m is a positive integer.

Examples

			a(17) = 1 since 17 = 7 + 10 with 6*7 - 1 = 41, 6*7 + 1 = 43 and 7 + phi(10) = 7 + 4 = 11 all prime.
a(486) = 1 since 486 = 325 + 161 with 6*325 - 1 = 1949, 6*325 + 1 = 1951 and 325 + phi(161) = 325 + 132 = 457 all prime.
		

Programs

  • Mathematica
    p[n_,k_]:=PrimeQ[6k-1]&&PrimeQ[6k+1]&&PrimeQ[k+EulerPhi[n-k]]
    a[n_]:=Sum[If[p[n,k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

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

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Jan 03 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>4.
This has been verified for n up to 10^8. It implies that there are infinitely many cousin primes and also infinitely many sexy primes.

Examples

			a(5)=1 since 5=4+1 with 2*4-3, 2*4+3, 6*1+1 and 6*1+5 all prime.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[2k-3]==True&&PrimeQ[2k+3]==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}]

A255472 Number of decompositions of 2n into sums of two primes p <= q such that one or both p and q are elements of A023201.

Original entry on oeis.org

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

Author

Lei Zhou, Feb 23 2015

Keywords

Comments

Conjecture: for all n > 3, a(n) > 0.
If 2n = p + q and p+6 is also a prime, 2n+6 can be written as the sum of two primes p+6 and q.
The conjecture is weaker than a conjecture of Sun posed in 2012 (see A219055). - Zhi-Wei Sun, Mar 18 2015

Examples

			n=4: 2n=8=3+5, 5+6=11 is also a prime number. This is the only occurrence, so a(4)=1.
n=5: 2n=10=3+7=5+5. Both 5+6=11 and 7+6=13 are prime numbers. Two occurrences found, so a(5)=2.
		

Crossrefs

Programs

  • Mathematica
    Table[e = 2 n; ct = 0; p1 = 2; While[p1 = NextPrime[p1]; p1 <= n, p2 = e - p1; If[PrimeQ[p2], If[PrimeQ[p1 + 6] || PrimeQ[p2 + 6], ct++]]]; ct, {n, 1, 100}]
  • PARI
    a(n) = {nb = 0; forprime(p=2, 2*n, if ((q=2*n-p) && (q <= p) && isprime(q=2*n-p) && (isprime(q+6) || isprime(p+6)), nb++);); nb;} \\ Michel Marcus, Mar 01 2015
Showing 1-9 of 9 results.