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

%I #46 Apr 18 2022 22:28:17

%S 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,

%T 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,

%U 36,19,10,3,1,1,4,14,32,65,104,150,180,196,180

%N 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.

%C 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.

%H Peter Luschny, <a href="/A026536/b026536.txt">Table of n, a(n) for row 0..100, flattened</a>

%H <a href="/index/Pas#Pascal">Index entries for triangles and arrays related to Pascal's triangle</a>

%e First 5 rows:

%e 1

%e 1 0 1

%e 1 1 2 1 1

%e 1 1 3 2 3 1 1

%e 1 2 5 6 8 6 5 2 1

%t z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2];

%t t[n_, k_] := Floor[n/2] /; k == 2 n - 1; t[n_, k_] := t[n, k] =

%t If[EvenQ[n], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k], t[n - 1, k -

%t 2] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];

%t TableForm[u] (* A026536 array *)

%t v = Flatten[u] (* A026536 sequence *)

%o (SageMath)

%o @cached_function

%o def T(n, k):

%o if k < 0 or n < 0: return 0

%o elif k == 0 or k == 2*n: return 1

%o elif k == 1 or k == 2*n-1: return n//2

%o elif n % 2 == 1: return T(n-1, k-2) + T(n-1, k)

%o return T(n-1, k-2) + T(n-1, k-1) + T(n-1, k) # _Peter Luschny_, Oct 13 2019

%Y Cf. A026537, A026538, A026539, A026540, A026541, A026545, A026546, A026547, A026548, A026549, A026550, A027267, A027268, A027269, A027270, A027271, A352972.

%Y Cf. A026519, A026527, A026552, A026584, A027926.

%K nonn,tabf

%O 0,7

%A _Clark Kimberling_

%E Updated by _Clark Kimberling_, Aug 28 2014

%E Offset changed to 0 by _Peter Luschny_, Oct 10 2019

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 April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)