login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A348478 Number of compositions of n into exactly n nonnegative parts such that each positive i-th part has the same parity as i. 2
1, 1, 1, 4, 7, 23, 55, 164, 407, 1235, 3051, 9432, 23431, 72989, 182624, 571384, 1436855, 4511979, 11387467, 35866100, 90782837, 286622226, 727226578, 2300578392, 5848776767, 18533394763, 47197285045, 149769168304, 381956145802, 1213526310665, 3098742448230 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
EXAMPLE
a(0) = 1: [].
a(1) = 1: [1].
a(2) = 1: [0,2].
a(3) = 4: [1,2,0], [0,2,1], [3,0,0], [0,0,3].
a(4) = 7: [1,2,1,0], [1,0,1,2], [3,0,1,0], [1,0,3,0], [0,2,0,2], [0,4,0,0], [0,0,0,4].
MAPLE
b:= proc(n, t) option remember; `if`(t=0, 1-signum(n),
add(`if`(j=0 or (t-j)::even, b(n-j, t-1), 0), j=0..n))
end:
a:= n-> b(n$2):
seq(a(n), n=0..33);
MATHEMATICA
b[n_, t_] := b[n, t] = If[t == 0, 1 - Sign[n],
Sum[If[j == 0 || EvenQ[t - j], b[n - j, t - 1], 0], {j, 0, n}]];
a[n_] := b[n, n];
Table[a[n], {n, 0, 33}] (* Jean-François Alcover, Apr 14 2022, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A101824 A270238 A027946 * A363543 A242315 A275313
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Oct 20 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 2 04:38 EDT 2024. Contains 374821 sequences. (Running on oeis4.)