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.

A219347 Number of partitions of n into distinct parts with smallest possible largest part.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 3, 2, 2, 1, 1, 1, 4, 3, 2, 2, 1, 1, 1, 5, 4, 3, 2, 2, 1, 1, 1, 6, 5, 4, 3, 2, 2, 1, 1, 1, 8, 6, 5, 4, 3, 2, 2, 1, 1, 1, 10, 8, 6, 5, 4, 3, 2, 2, 1, 1, 1, 12, 10, 8, 6, 5, 4, 3, 2, 2, 1, 1, 1, 15, 12, 10, 8, 6, 5
Offset: 0

Views

Author

Alois P. Heinz, Nov 18 2012

Keywords

Comments

Size of the smallest possible largest part is floor(sqrt(2*n)+1/2) = A002024(n). Records occur at 0, 7, and A000124(k) for k>=5.

Examples

			a(0) = 1: [].
a(7) = 2: [4,2,1], [4,3].
a(16) = 3: [6,4,3,2,1], [6,5,3,2], [6,5,4,1].
a(22) = 4: [7,5,4,3,2,1], [7,6,4,3,2], [7,6,5,3,1], [7,6,5,4].
		

Crossrefs

Cf. A000009 (records), A219339.

Programs

  • Maple
    g:= proc(n, i) option remember; local s; s:=i*(i+1)/2;
          `if`(n=s, 1, `if`(n>s, 0, g(n, i-1)+ `if`(i>n, 0, g(n-i, i-1))))
        end:
    a:= n-> g(n, floor(sqrt(2*n)+1/2)):
    seq (a(n), n=0..120);
  • Mathematica
    g[n_, i_] := g[n, i] = Module[{s = i(i+1)/2}, If[n == s, 1, If[n > s, 0, g[n, i - 1] + If[i > n, 0, g[n - i, i - 1]]]]];
    a[n_] := g[n, Floor[Sqrt[2n] + 1/2]];
    a /@ Range[0, 120] (* Jean-François Alcover, Dec 10 2020, after Alois P. Heinz *)