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.

A096765 Number of partitions of n into distinct parts, the least being 1.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 8, 10, 12, 15, 17, 21, 25, 29, 35, 41, 48, 56, 66, 76, 89, 103, 119, 137, 159, 181, 209, 239, 273, 312, 356, 404, 460, 522, 591, 669, 757, 853, 963, 1085, 1219, 1371, 1539, 1725, 1933, 2164, 2418, 2702, 3016, 3362, 3746, 4171, 4637
Offset: 0

Views

Author

N. J. A. Sloane, Sep 28 2008

Keywords

Comments

The old entry with this sequence number was a duplicate of A071569.
a(n) is also the total number of 1's in all partitions of n into distinct parts. For n=6 there are partitions [6], [5,1], [4,2], [3,2,1] and only two contain a 1, hence a(6) = 2. - T. Amdeberhan, May 13 2012
a(n), n > 1 is the Euler transform of [0,1,1] joined with period [0,1]. - Georg Fischer, Aug 15 2020

Examples

			G.f. = x + x^3 + x^4 + x^5 + 2*x^6 + 2*x^7 + 3*x^8 + 3*x^9 + 5*x^10 + 5*x^11 + ...
		

Crossrefs

Cf. A096749 (least=2), A022824 (3), A022825 (4), A022826 (5), A022827 (6), A022828 (7), A022829 (8), A022830 (9), A022831 (10).

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0, 1, `if`((i-1)*(i+2)/2 `if`(n<1, 0, b(n-1$2)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Feb 07 2014
    # Using the function EULER from Transforms (see link at the bottom of the page).
    [0,1,op(EULER([0,1,seq(irem(n,2),n=1..56)]))]; # Peter Luschny, Aug 19 2020
  • Mathematica
    p[, 0] = 1; p[k, n_] := p[k, n] = If[n < k, 0, p[k+1, n-k] + p[k+1, n]]; a[n_] := p[2, n-1]; Table[a[n], {n, 0, 59}] (* Jean-François Alcover, Apr 17 2014, after Reinhard Zumkeller *)
    a[ n_] := SeriesCoefficient[ x / ((1 + x) Product[ 1 - x^j, {j, 1, n, 2}]), {x, 0, n}]; (* Michael Somos, Sep 10 2016 *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[  Sum[ x^(k (k + 1)/2) / Product[ 1 - x^j, {j, 1, k - 1}], {k, 1, Quotient[-1 + Sqrt[8 n + 1], 2]}], {x, 0, n}]]; (* Michael Somos, Sep 10 2016 *)
    Join[{0}, Table[Count[Last /@ Select[IntegerPartitions@n, DeleteDuplicates[#] == # &], 1], {n, 66}]] (* Robert Price, Jun 13 2020 *)
  • PARI
    {a(n) = if( n<1, 0, polcoeff( x / ((1 + x) * prod(k=1, (n+1)\2, 1 - x^(2*k-1), 1 + O(x^n))), n))}; /* Michael Somos, Sep 10 2016 */

Formula

a(n) = A025147(n-1), n>1. - R. J. Mathar, Jul 31 2008
G.f.: x*Product_{j=2..infinity} (1+x^j). - R. J. Mathar, Jul 31 2008
G.f.: x / ((1 + x) * Product_{k>0} (1 - x^(2*k-1))). - Michael Somos, Sep 10 2016
G.f.: Sum_{k>0} x^(k*(k+1)/2) / Product_{j=1..k-1} (1 - x^j). - Michael Somos, Sep 10 2016