login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A339416
Number of compositions (ordered partitions) of n into an even number of triangular numbers.
3
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,5
FORMULA
G.f.: (1/2) * (1 / (1 - Sum_{k>=1} x^(k*(k + 1)/2)) + 1 / Sum_{k>=0} x^(k*(k + 1)/2)).
a(n) = (A023361(n) + A106507(n)) / 2.
a(n) = Sum_{k=0..n} A023361(k) * A106507(n-k).
EXAMPLE
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].
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]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 03 2020
STATUS
approved