login
Number of compositions (ordered partitions) of n into centered hexagonal numbers (A003215).
3

%I #7 Dec 28 2018 20:35:34

%S 1,1,1,1,1,1,1,2,3,4,5,6,7,8,10,13,17,22,28,36,45,56,70,88,111,140,

%T 178,226,286,361,455,573,721,909,1148,1451,1834,2318,2928,3695,4661,

%U 5880,7420,9366,11826,14935,18860,23812,30059,37941,47888,60445,76302,96327

%N Number of compositions (ordered partitions) of n into centered hexagonal numbers (A003215).

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HexNumber.html">Hex Number</a>

%H <a href="/index/Com#comp">Index entries for sequences related to compositions</a>

%F G.f.: 1/(1 - Sum_{k>=0} x^(3*k*(k+1)+1)).

%p h:= proc(n) option remember; `if`(n<0, 0, (t->

%p `if`(3*t*(t+1)+1>n, t-1, t))(1+h(n-1)))

%p end:

%p a:= proc(n) option remember; `if`(n=0, 1,

%p add(a(n-(3*i*(i+1)+1)), i=0..h(n)))

%p end:

%p seq(a(n), n=0..60); # _Alois P. Heinz_, Dec 28 2018

%t nmax = 53; CoefficientList[Series[1/(1 - Sum[x^(3 k (k + 1) + 1), {k, 0, nmax}]), {x, 0, nmax}], x]

%Y Cf. A003215, A280863, A280953, A281084, A282502, A282504, A322798, A322801, A322803.

%K nonn

%O 0,8

%A _Ilya Gutkovskiy_, Dec 26 2018