login
Number of compositions of n into exactly n nonnegative parts such that all positive parts are odd.
3

%I #16 May 16 2022 02:45:58

%S 1,1,1,4,13,36,106,323,981,2992,9196,28392,87946,273287,851579,

%T 2659764,8324357,26100560,81969496,257800532,811862268,2559731360,

%U 8079294664,25525787344,80719066698,255466082911,809138591431,2564605664428,8134003910311,25813957574292

%N Number of compositions of n into exactly n nonnegative parts such that all positive parts are odd.

%H Alois P. Heinz, <a href="/A348476/b348476.txt">Table of n, a(n) for n = 0..1968</a>

%F a(n) ~ c * d^n / sqrt(Pi*n), where d = 3.22870495109450172934784925586... is largest positive root of the equation 4*d^4 - 12*d^3 + 4*d^2 - 24*d + 5 = 0 and c = 0.4302331663731241127284415754... is positive root of the equation 5824*c^8 - 32*c^4 - 4*c^2 - 5 = 0. - _Vaclav Kotesovec_, Nov 01 2021

%e a(0) = 1: [].

%e a(1) = 1: [1].

%e a(2) = 1: [1,1].

%e a(3) = 4: [3,0,0], [0,3,0], [0,0,3], [1,1,1].

%e a(4) = 13: [3,1,0,0], [3,0,1,0], [3,0,0,1], [1,3,0,0], [0,3,1,0], [0,3,0,1],[1,0,3,0], [0,1,3,0], [0,0,3,1], [1,0,0,3], [0,1,0,3], [0,0,1,3], [1,1,1,1].

%p b:= proc(n, t) option remember; `if`(t=0, 1-signum(n),

%p add(`if`(j=0 or j::odd, b(n-j, t-1), 0), j=0..n))

%p end:

%p a:= n-> b(n$2):

%p seq(a(n), n=0..30);

%t b[n_, t_] := b[n, t] = If[t == 0, 1 - Sign[n],

%t Sum[If[j == 0 || OddQ[j], b[n - j, t - 1], 0], {j, 0, n}]];

%t a[n_] := b[n, n];

%t Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, May 16 2022, after _Alois P. Heinz_ *)

%Y Cf. A001700, A088218, A165817, A305161, A324969.

%K nonn

%O 0,4

%A _Alois P. Heinz_, Oct 19 2021