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.

A336903 Sum of the largest parts of all compositions of n into distinct parts.

Original entry on oeis.org

0, 1, 2, 7, 10, 19, 42, 61, 98, 151, 304, 403, 654, 925, 1400, 2431, 3328, 4903, 7056, 10117, 13952, 23419, 30406, 44683, 61308, 87289, 116822, 164359, 247774, 327715, 457542, 624445, 855062, 1148023, 1559188, 2058643, 3043506, 3906637, 5375732, 7111975, 9679852
Offset: 0

Views

Author

Alois P. Heinz, Aug 07 2020

Keywords

Examples

			a(6) = 42 = 3 + 3 + 3 + 3 + 3 + 3 + 4 + 4 + 5 + 5 + 6: 12(3), 1(3)2, 21(3), 2(3)1, (3)12, (3)21, 2(4), (4)2, 1(5), (5)1, (6).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(i*(i+1)/2 `if`(n=0, 0, b(n$2, 0)):
    seq(a(n), n=0..50);
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[i(i + 1)/2 < n, 0,
         If[n == 0, p!, b[n - i, Min[n - i, i - 1], p + 1]*
         If[p == 0, i, 1] + b[n, i - 1, p]]];
    a[n_] := If[n == 0, 0, b[n, n, 0]];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)

Formula

a(n) == n (mod 2).