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.

A024938 Total number of parts in all partitions of n into distinct prime parts.

Original entry on oeis.org

0, 1, 1, 0, 3, 0, 3, 2, 2, 5, 1, 5, 3, 5, 5, 7, 5, 10, 6, 10, 12, 10, 15, 12, 16, 17, 17, 19, 22, 17, 27, 21, 30, 30, 31, 35, 36, 40, 45, 45, 49, 53, 50, 62, 60, 69, 69, 73, 78, 85, 88, 98, 100, 105, 116, 116, 134, 135, 141, 149, 154, 168, 176, 188, 195, 206, 211, 232, 242, 255, 267, 276
Offset: 1

Views

Author

Keywords

Examples

			a(16) = 7 because the partitions of 16 into distinct prime parts are [13,3], [11,5] and [11,3,2].
		

Crossrefs

Cf. A084993.

Programs

  • Maple
    g:=sum(x^ithprime(j)/(1+x^ithprime(j)),j=1..30)*product(1+x^ithprime(j),j=1..30): gser:=series(g,x=0,80): seq(coeff(gser,x,n),n=1..75); # Emeric Deutsch, Apr 01 2006
    # second Maple program:
    with(numtheory):
    b:= proc(n, i) option remember; local g;
          if n=0 then [1, 0]
        elif i<1 then [0, 0]
        else g:= `if`(ithprime(i)>n, [0$2], b(n-ithprime(i), i-1));
             b(n, i-1) +g +[0, g[1]]
          fi
        end:
    a:= n-> b(n, pi(n))[2]:
    seq(a(n), n=1..80);  # Alois P. Heinz, Oct 30 2012
  • Mathematica
    Rest@ CoefficientList[ Series[ Sum[x^Prime@j/(1 + x^Prime@j), {j, 20}]* Product[1 + x^Prime@j, {j, 20}], {x, 0, 70}], x] (* Robert G. Wilson v *)
    b[n_, i_] := b[n, i] = Module[{g}, If[n==0, {1, 0}, If[i < 1, {0, 0}, g = If[ Prime[i] > n, {0, 0}, b[n - Prime[i], i-1]]; b[n, i-1] + g + {0, g[[1]]}]]]; a[n_] := b[n, PrimePi[n]][[2]]; Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Dec 27 2015, after Alois P. Heinz *)
  • PARI
    sumparts(n, pred)={sum(k=1, n, 1 - 1/(1+pred(k)*x^k) + O(x*x^n))*prod(k=1, n, 1+pred(k)*x^k + O(x*x^n))}
    {my(n=60); Vec(sumparts(n, isprime), -n)} \\ Andrew Howroyd, Dec 28 2017

Formula

G.f.: sum(x^p(j)/(1+x^p(j)),j>=1)*product(1+x^p(j), j>=1), where p(j) is the j-th prime. - Vladeta Jovovic, Jul 17 2003

Extensions

More terms from Vladeta Jovovic, Jul 17 2003