A339416 Number of compositions (ordered partitions) of n into an even number of triangular numbers.
1, 0, 1, 0, 3, 0, 6, 2, 13, 6, 28, 20, 61, 56, 135, 148, 308, 380, 707, 950, 1654, 2340, 3897, 5714, 9252, 13858, 22055, 33492, 52735, 80744, 126313, 194376, 302906, 467506, 726862, 1123830, 1744947, 2700682, 4190016, 6488824, 10062649, 15588714, 24168232, 37447884
Offset: 0
Keywords
Examples
a(9) = 6 because we have [6, 3], [3, 6], [6, 1, 1, 1], [1, 6, 1, 1], [1, 1, 6, 1] and [1, 1, 1, 6].
Links
Programs
-
Maple
b:= proc(n, t) option remember; local r, f, g; if n=0 then t else r, f, g:=$0..2; while f<=n do r, f, g:= r+b(n-f, 1-t), f+g, g+1 od; r fi end: a:= n-> b(n, 1): seq(a(n), n=0..50); # Alois P. Heinz, Dec 03 2020
-
Mathematica
nmax = 43; CoefficientList[Series[(1/2) (1/(1 - Sum[x^(k (k + 1)/2), {k, 1, nmax}]) + 1/Sum[x^(k (k + 1)/2), {k, 0, nmax}]), {x, 0, nmax}], x]