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

A002124 Number of compositions of n into a sum of odd primes.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 2, 1, 3, 4, 3, 7, 7, 8, 14, 15, 21, 28, 33, 47, 58, 76, 103, 125, 169, 220, 277, 373, 476, 616, 810, 1037, 1361, 1763, 2279, 2984, 3846, 5006, 6521, 8428, 10983, 14249, 18480, 24048, 31178, 40520, 52635, 68281, 88765, 115211, 149593, 194381, 252280, 327696, 425587, 552527, 717721
Offset: 0

Views

Author

Keywords

Comments

Arises in studying the Goldbach conjecture.
The g.f. -(z-1)*(z+1)*(z**2+z+1)*(z**2-z+1)/(1-z**6-z**3-z**5-z**7+z**9) conjectured by Simon Plouffe in his 1992 dissertation is wrong.

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    import Data.List (genericIndex)
    a002124 n = genericIndex a002124_list n
    a002124_list = 1 : f 1 [] a065091_list where
       f x qs ps'@(p:ps)
         | p <= x    = f x (p:qs) ps
         | otherwise = sum (map (a002124 . (x -)) qs) : f (x + 1) qs ps'
    -- Reinhard Zumkeller, Mar 21 2014
  • Maple
    A002124 := proc(n) coeff(series(1/(1-add(z^numtheory[ithprime](j),j=2..n)),z=0,n+1),z,n) end;
    M:=120; a:=array(0..M); a[0]:=1; a[1]:=0; a[2]:=0; for n from 3 to M do t1:=0; for k from 2 to n do p := ithprime(k); if p <= n then t1 := t1 + a[n-p]; fi; od: a[n]:=t1; od: [seq(a[n],n=0..M)]; # N. J. A. Sloane, after MacMahon, Dec 03 2006; used in A002125
  • Mathematica
    a[0] = 1; a[1] = a[2] = 0; a[n_] := a[n] = (s = 0; p = 3; While[p <= n, s = s + a[n-p]; p = NextPrime[p]]; s); a /@ Range[0, 58] (* Jean-François Alcover, Jun 28 2011, after P. A. MacMahon *)

Formula

a(0)=1, a(1)=a(2)=0; for n >= 3, a(n) = Sum_{ primes p with 3 <= p <= n} a(n-p). [MacMahon]
G.f.: 1/( 1 - Sum_{k>=2} x^A000040(k) ). [Joerg Arndt, Sep 30 2012]

Extensions

Better description and more terms from Philippe Flajolet, Nov 11 2002
Edited by N. J. A. Sloane, Dec 03 2006

A283875 Number of partitions of n into twin primes (A001097).

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 7, 7, 9, 9, 11, 12, 13, 15, 16, 19, 20, 23, 25, 27, 31, 33, 37, 40, 44, 49, 52, 59, 63, 69, 76, 81, 90, 96, 106, 114, 123, 135, 144, 157, 169, 183, 197, 212, 230, 246, 266, 286, 307, 330, 353, 381, 406, 436, 468, 499, 536, 572, 613, 654, 698, 746, 795, 849, 904, 964
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 17 2017

Keywords

Comments

Conjecture: every number > 7 is the sum of at most 4 twin primes (automatically implies the truth of the first version of the twin prime conjecture). For example: 8 = 5 + 3; 9 = 3 + 3 + 3; 10 = 5 + 5; 11 = 5 + 3 + 3; 12 = 7 + 5, etc.

Examples

			a(16) = 4 because we have [13, 3], [11, 5], [7, 3, 3, 3] and [5, 5, 3, 3].
		

Crossrefs

Programs

  • Mathematica
    nmax = 79; CoefficientList[Series[Product[1/(1 - Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k), {k, 1, nmax}], {x, 0, nmax}], x]
  • PARI
    Vec(prod(k=1, 79, 1/(1 - (isprime(k) && (isprime(k - 2) || isprime(k + 2)))*x^k)) + O(x^80)) \\ Indranil Ghosh, Mar 17 2017

Formula

G.f.: Product_{k>=1} 1/(1 - x^A001097(k)).

A283876 Number of partitions of n into distinct twin primes (A001097).

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 4, 2, 4, 4, 3, 4, 4, 5, 4, 4, 5, 5, 5, 5, 6, 6, 5, 7, 6, 8, 7, 7, 9, 7, 9, 8, 9, 9, 9, 9, 11, 11, 11, 12, 11, 14, 12, 13, 14, 14, 13, 15, 15, 17, 16, 16, 19, 17, 20, 19, 21, 21, 21, 21, 23, 23, 23, 23, 24, 26, 25, 28, 28, 30, 29, 30, 32
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 17 2017

Keywords

Examples

			a(29) = 4 because we have [29], [19, 7, 3], [17, 7, 5] and [13, 11, 5].
		

Crossrefs

Programs

  • Mathematica
    nmax = 95; CoefficientList[Series[Product[1 + Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k, {k, 1, nmax}], {x, 0, nmax}], x]
  • PARI
    listA001097(lim)=my(v=List([3]),p=5); forprime(q=7,lim, if(q-p==2, listput(v,p); listput(v,q)); p=q); if(p+2>lim && isprime(p+2), listput(v,p)); Vec(v)
    first(n)=my(v=listA001097(n),x=O('x^(n+1))+'x); Vec(prod(i=1,#v, 1+x^v[i]))[1..n+1] \\ Charles R Greathouse IV, Mar 17 2017
    
  • PARI
    Vec(prod(k=1, 95, (1 + (isprime(k) && (isprime(k - 2) || isprime(k + 2)))*x^k)) + O(x^96)) \\ Indranil Ghosh, Mar 17 2017

Formula

G.f.: Product_{k>=1} (1 + x^A001097(k)).

A299196 Number of partitions of n into distinct parts that are lesser of twin primes (A001359).

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 2, 0, 1, 2, 0, 1, 1, 0, 1, 1, 0, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 0, 1, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 0, 2, 1, 0, 2, 1, 1, 3, 2, 1, 3, 2, 2, 2, 0, 2, 2, 0, 1, 2, 2, 2, 2, 3, 3, 3
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 04 2018

Keywords

Comments

For n > 0 let b(n) be the inverse Euler transform of a(n). It appears that, if p is the lesser of twin primes, then b(p) = 1 and b(2*p) = -1; otherwise b(n) = 0. - Georg Fischer, Aug 15 2020

Examples

			a(46) = 2 because we have [41, 5] and [29, 17].
		

Crossrefs

Programs

  • Maple
    P:= select(isprime,{seq(i,i=3..201,2)}):
    TP:= P intersect map(`-`,P,2):
    G:= mul(1+x^p,p=TP):
    seq(coeff(G,x,i),i=0..200); # Robert Israel, Dec 15 2024
  • Mathematica
    nmax = 105; CoefficientList[Series[Product[1 + Boole[PrimeQ[k] && PrimeQ[k + 2]] x^k, {k, 1, nmax}], {x, 0, nmax}], x]

Formula

G.f.: Product_{k>=1} (1 + x^A001359(k)).

A282971 Number of compositions (ordered partitions) of n into primes of form x^2 + y^2 (A002313).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 2, 1, 3, 2, 4, 4, 6, 7, 9, 11, 15, 18, 24, 29, 37, 48, 58, 78, 92, 124, 149, 195, 243, 308, 393, 490, 629, 786, 1004, 1263, 1603, 2024, 2564, 3239, 4106, 5184, 6571, 8301, 10508, 13298, 16807, 21296, 26895, 34082, 43060, 54528, 68952, 87245, 110392, 139622, 176696, 223484, 282798, 357731
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 25 2017

Keywords

Comments

Number of compositions (ordered partitions) of n into primes congruent to 1 or 2 mod 4.
Conjecture: every number > 16 is the sum of at most 4 primes of form x^2 + y^2.

Examples

			a(12) = 4 because we have [5, 5, 2], [5, 2, 5], [2, 2, 5] and [2, 2, 2, 2, 2, 2].
		

Crossrefs

Programs

  • Mathematica
    nmax = 60; CoefficientList[Series[1/(1 - Sum[Boole[SquaresR[2, k] != 0 && PrimeQ[k]] x^k, {k, 1, nmax}]), {x, 0, nmax}], x]
  • PARI
    Vec(1/(1 - sum(k=1, 60, (isprime(k) && k%4<3)*x^k)) + O(x^61)) \\ Indranil Ghosh, Mar 15 2017

Formula

G.f.: 1/(1 - Sum_{k>=1} x^A002313(k)).

A299197 Number of partitions of n into distinct parts that are greater of twin primes (A006512).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Feb 04 2018

Keywords

Examples

			a(31) = 2 because we have [31] and [19, 7, 5].
		

Crossrefs

Programs

  • Mathematica
    nmax = 105; CoefficientList[Series[Product[1 + Boole[PrimeQ[k] && PrimeQ[k - 2]] x^k, {k, 1, nmax}], {x, 0, nmax}], x]

Formula

G.f.: Product_{k>=1} (1 + x^A006512(k)).

A332033 Number of compositions (ordered partitions) of n into distinct twin primes.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 1, 2, 1, 2, 6, 4, 1, 4, 7, 4, 12, 4, 12, 6, 12, 26, 18, 26, 19, 4, 19, 52, 18, 52, 24, 54, 24, 74, 144, 98, 25, 76, 145, 100, 258, 102, 150, 104, 156, 124, 396, 146, 282, 148, 396, 890, 510, 890, 403, 198, 403, 940, 636, 988, 642
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 05 2020

Keywords

Examples

			a(15) = 6 because we have [7, 5, 3], [7, 3, 5], [5, 7, 3], [5, 3, 7], [3, 7, 5] and [3, 5, 7].
		

Crossrefs

A372510 Number of ordered factorizations of 2*n-1 into twin primes.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, May 04 2024

Keywords

Examples

			a(23) = 3 because we have 23 * 2 - 1 = 45 = 3 * 3 * 5 = 3 * 5 * 3 = 5 * 3 * 3.
		

Crossrefs

Formula

If 2*n-1 = Product A001097(k)^e(k) then a(n) = A008480(2*n-1), otherwise 0.
Showing 1-8 of 8 results.