[go: up one dir, main page]

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!)
A221235 Number of nonnegative integer arrays of length n summing to n without adjacent equal values. 3
1, 1, 2, 7, 14, 30, 76, 188, 444, 1075, 2656, 6504, 15926, 39316, 97252, 240597, 596686, 1482971, 3689768, 9191590, 22927718, 57253334, 143101896, 358003469, 896391914, 2246149936, 5632310800, 14132640565, 35483595966, 89141668532, 224061612932, 563473301874 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..500 (first 210 terms from R. H. Hardin)
FORMULA
a(n) = A106351(2n,n). - Alois P. Heinz, Oct 12 2017
EXAMPLE
All solutions for n=3
..1....2....0....2....0....0....1
..2....1....3....0....2....1....0
..0....0....0....1....1....2....2
MAPLE
b:= proc(n, h, t) option remember; `if`(t<2, `if`(n<>h, 1, 0),
add(`if`(h=j, 0, b(n-j, `if`(j>n-j, -1, j), t-1)), j=0..n))
end:
a:= n-> b(n, -1, n):
seq(a(n), n=0..35); # Alois P. Heinz, Oct 15 2017
MATHEMATICA
b[n_, h_, t_] := b[n, h, t] = If[t < 2, If[n != h, 1, 0],
Sum[If[h == j, 0, b[n-j, If[j > n-j, -1, j], t-1]], {j, 0, n}]];
a[n_] := b[n, -1, n];
Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Apr 28 2022, after Alois P. Heinz *)
CROSSREFS
Cf. A106351.
Sequence in context: A221318 A221319 A221320 * A224916 A258321 A034791
KEYWORD
nonn
AUTHOR
R. H. Hardin, Jan 10 2013
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, Oct 15 2017
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 29 09:16 EDT 2024. Contains 375511 sequences. (Running on oeis4.)