login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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. 26
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) = 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

Peter Luschny, Table of n, a(n) for row 0..100, flattend

Index entries for triangles and arrays related to Pascal's triangle

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

Cf. A026519, A026552, A026568, A026584, A027926, A026527.

Sequence in context: A029385 A185155 A249095 * A046213 A215625 A260222

Adjacent sequences:  A026533 A026534 A026535 * A026537 A026538 A026539

KEYWORD

nonn,tabf

AUTHOR

Clark Kimberling

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 11 15:12 EDT 2020. Contains 336428 sequences. (Running on oeis4.)