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

A046927 Number of ways to express 2n+1 as p+2q where p and q are primes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is related to a conjecture of Lemoine (also sometimes called Levy's conjecture, although Levy was anticipated by Lemoine 69 years earlier). - Zhi-Wei Sun, Jun 10 2008
The conjecture states that any odd number greater than 5 can be written as p+2q where p and q are primes.
It can be conjectured that 1, 3, 5, 59 and 151 are the only odd integers n such that n + 2p and n + 2q both are composite for all primes p,q with n = p + 2q. (Following an observation from V. Shevelev, cf. link to SeqFan list.) - M. F. Hasler, Apr 10 2017

References

  • L. E. Dickson, "History of the Theory of Numbers", Vol. I (Amer. Math. Soc., Chelsea Publ., 1999); see p. 424.

Crossrefs

Cf. A194831 (records), A194830 (positions of records).

Programs

  • Mathematica
    a[n_] := (ways = 0; Do[p = 2k + 1; q = n-k; If[PrimeQ[p] && PrimeQ[q], ways++], {k, 1, n}]; ways); Table[a[n], {n, 0, 91}] (* Jean-François Alcover, Dec 05 2012 *)
    Table[Count[FrobeniusSolve[{1, 2}, 2 n + 1], {?PrimeQ}], {n, 0, 91}] (* Jan Mangaldan, Apr 08 2013 *)
  • PARI
    a(n)=my(s);n=2*n+1;forprime(p=2,n\2,s+=isprime(n-2*p));s \\ Charles R Greathouse IV, Jul 17 2013

Formula

For n >= 1, a(n) = Sum_{3<=p<=n+1, p prime} A((2*n + 1 - p)/2) + Sum_{2<=q<=(n+1)/2, q prime} B(2*n + 1 - 2*q) - A((n+1)/2)*B(n+1) - a(n-1) - ... - a(0), where A(n) = A000720(n), B(n) = A033270(n). - Vladimir Shevelev, Jul 12 2013

Extensions

Additional references from Zhi-Wei Sun, Jun 10 2008

A194831 Records in the number of ways to express an odd number as a sum 2*p+q, with p, q primes.

Original entry on oeis.org

1, 2, 4, 5, 6, 7, 8, 11, 12, 13, 14, 16, 21, 22, 26, 27, 31, 32, 35, 43, 48, 52, 65, 77, 87, 101, 104, 115, 128, 133, 146, 155, 169, 180, 188, 194, 196, 201, 209, 225, 228, 248, 250, 282, 286, 325, 332, 359, 391, 400, 443, 449, 470, 555, 579, 582, 679, 741
Offset: 1

Views

Author

Hugo Pfoertner, Sep 12 2011

Keywords

Comments

Records in A046927. The growth rate of this sequence makes the slow growth of A194829 plausible, i.e. 2*n+1 can be represented by 2*p+q with q<

Examples

			a(1)=1: A194830(1)=7 has 1 representation 7=2*2+3; a(2)=2 representations of A194830(2)=9=2*2+5=2*3+3; a(3)=4 representations of A194830(3)=17=2*2+13=2*3+11=2*5+7=2*7+3.
		

References

Crossrefs

Cf. A194830 [record-setting numbers], A046927, A194828, A194829.

Programs

  • Mathematica
    ways[n_] := ways[n] = (w = 0; Do[ p = 2k + 1; q = n - k; If[PrimeQ[p] && PrimeQ[q], w++], {k, 1, n}]; w); record = 0; A194831 = Reap[Do[If[ways[n] > record, record = ways[n]; Print["2n+1 = ", 2n + 1, " record = ", record]; Sow[{ways[n], n}]], {n, 0, 12000}]][[2, 1]][[All, 1]] (* Jean-François Alcover, Dec 05 2012 *)

A269329 Number of partitions of a positive integer n into two distinct primes such that for even n, it is of the form n = p + q and for odd n, it is of the form n = 2p' + q'.

Original entry on oeis.org

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

Author

Frank M Jackson and M. B. Rees, Feb 23 2016

Keywords

Comments

This sequence combines Levy's conjecture for odd positive numbers with the Goldbach conjecture for even positive numbers and strenghtens both by restricting the prime pairs to be distinct. I.e., every positive integer n > 6 is the sum of two distinct primes p and q such that for n even, it is of the form n = p + q and for n odd, it is of the form n = 2p' + q'.

Examples

			a(23)=3. Hence there are 3 partitions (as defined above) of the odd integer 23, namely 19+2+2, 17+3+3 and 13+5+5. a(24)=3. Hence there are 3 partitions of the even integer 24, namely 19+5, 17+7 and 13+11.
		

Crossrefs

Programs

  • Mathematica
    parts[n_, a_, b_] := Select[IntegerPartitions[n, {a+b}, Prime@Range[PrimePi[n]]], Length[Union@#]==2&&MemberQ[Values@Counts@#, a] &]; lst1=Table[Length@parts[2n-1, 1, 2], {n, 1, 200}]; lst2=Table[Length@parts[2n, 1, 1], {n, 1, 200}]; Riffle[lst1, lst2]
Showing 1-3 of 3 results.