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.

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