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!)
A364529 Number of compositions of 2n into n parts where differences between neighboring parts are in {-1,1}. 4
1, 1, 0, 2, 4, 2, 0, 6, 14, 8, 0, 25, 60, 35, 0, 114, 270, 157, 0, 528, 1242, 722, 0, 2481, 5826, 3390, 0, 11816, 27728, 16145, 0, 56841, 133316, 77660, 0, 275485, 645878, 376382, 0, 1343083, 3148000, 1835076, 0, 6579707, 15418652, 8990528, 0, 32363357, 75826214 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = A309938(2n,n).
a(n) = 0 <=> n in { A016825 }.
EXAMPLE
a(0) = 1: (), the empty composition.
a(1) = 1: [2].
a(3) = 2: [1,2,3], [3,2,1].
a(4) = 4: [1,2,3,2], [2,1,2,3], [2,3,2,1], [3,2,1,2].
a(5) = 2: [2,1,2,3,2], [2,3,2,1,2].
a(7) = 6: [1,2,1,2,3,2,3], [1,2,3,2,1,2,3], [1,2,3,2,3,2,1], [3,2,1,2,1,2,3], [3,2,1,2,3,2,1], [3,2,3,2,1,2,1].
MAPLE
b:= proc(n, i, k) option remember;
`if`(n<1 or i<1 or k<0 or 3/2*k>n, 0,
`if`(n=i, `if`(k=0, 1, 0),
add(b(n-i, i+j, k-1), j=[-1, 1])))
end:
a:= n-> `if`(n=0, 1, add(b(2*n, j, n-1), j=1..2*n)):
seq(a(n), n=0..48);
MATHEMATICA
b[n_, i_, k_] := b[n, i, k] = If[n < 1 || i < 1 || k < 0 || 3/2*k > n, 0, If[n == i, If[k == 0, 1, 0], Sum[b[n - i, i + j, k - 1], {j, {-1, 1}}]]];
a[n_] := If[n == 0, 1, Sum[b[2*n, j, n - 1], {j, 1, 2 n}]];
Table[a[n], {n, 0, 48}] (* Jean-François Alcover, Oct 27 2023, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A366589 A335764 A202069 * A300329 A094239 A273240
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 27 2023
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 May 4 10:30 EDT 2024. Contains 372240 sequences. (Running on oeis4.)