The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A026536 Irregular triangular array T read by rows: T(i,0 ) = T(i,2i) = 1 for i >= 0; T(i,1) = T(i,2i-1) = floor(i/2) for i >= 1; for even n >= 2, T(i,j) = T(i-1,j-2) + T(i-1,j-1) + T(i-1,j) for j = 2..2i-2, for odd n >= 3, T(i,j) = T(i-1,j-2) + T(i-1,j) for j = 2..2i-2. 27
1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 1, 3, 2, 3, 1, 1, 1, 2, 5, 6, 8, 6, 5, 2, 1, 1, 2, 6, 8, 13, 12, 13, 8, 6, 2, 1, 1, 3, 9, 16, 27, 33, 38, 33, 27, 16, 9, 3, 1, 1, 3, 10, 19, 36, 49, 65, 66, 65, 49, 36, 19, 10, 3, 1, 1, 4, 14, 32, 65, 104, 150, 180, 196, 180 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
COMMENTS
T(n, k) is the number of strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i) - s(i-1)| <= 1 if i is even, |s(i) - s(i-1)| = 1 if i is odd.
LINKS
EXAMPLE
First 5 rows:
1
1 0 1
1 1 2 1 1
1 1 3 2 3 1 1
1 2 5 6 8 6 5 2 1
MATHEMATICA
z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2];
t[n_, k_] := Floor[n/2] /; k == 2 n - 1; t[n_, k_] := t[n, k] =
If[EvenQ[n], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k], t[n - 1, k -
2] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
TableForm[u] (* A026536 array *)
v = Flatten[u] (* A026536 sequence *)
PROG
(SageMath)
@cached_function
def T(n, k):
if k < 0 or n < 0: return 0
elif k == 0 or k == 2*n: return 1
elif k == 1 or k == 2*n-1: return n//2
elif n % 2 == 1: return T(n-1, k-2) + T(n-1, k)
return T(n-1, k-2) + T(n-1, k-1) + T(n-1, k) # Peter Luschny, Oct 13 2019
CROSSREFS
Sequence in context: A029385 A185155 A249095 * A046213 A215625 A363096
KEYWORD
nonn,tabf
AUTHOR
EXTENSIONS
Updated by Clark Kimberling, Aug 28 2014
Offset changed to 0 by Peter Luschny, Oct 10 2019
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 14 09:19 EDT 2024. Contains 372532 sequences. (Running on oeis4.)