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!)
A026552 Irregular triangular array T read by rows: T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor(n/2 + 1), for even n >= 2, T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), otherwise T(n, k) = T(n-1, k-2) + T(n-1, k). 33

%I #28 Mar 01 2022 09:15:43

%S 1,1,1,1,1,2,3,2,1,1,2,4,4,4,2,1,1,3,7,10,12,10,7,3,1,1,3,8,13,19,20,

%T 19,13,8,3,1,1,4,12,24,40,52,58,52,40,24,12,4,1,1,4,13,28,52,76,98,

%U 104,98,76,52,28,13,4,1,1,5,18,45,93,156,226,278

%N Irregular triangular array T read by rows: T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor(n/2 + 1), for even n >= 2, T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), otherwise T(n, k) = T(n-1, k-2) + T(n-1, k).

%C T(n, k) = number of integer strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i)-s(i-1)|<=1 if i is even or i = 1, |s(i)-s(i-1)| = 1 if i is odd and i >= 3.

%H Clark Kimberling, <a href="/A026552/b026552.txt">Table of n, a(n) for n = 0..10200</a> [Offset changed to 0 by _Georg Fischer_, Mar 01 2022]

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

%F Sum_{k=0..2*n} T(n,k) = A026565(n). - _G. C. Greubel_, Dec 17 2021

%e First 5 rows:

%e 1;

%e 1, 1, 1;

%e 1, 2, 3, 2, 1;

%e 1, 2, 4, 4, 4, 2, 1;

%e 1, 3, 7, 10, 12, 10, 7, 3, 1;

%t z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2 + 1]; t[n_, k_] := Floor[n/2 + 1] /; 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}];

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

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

%o (Sage)

%o @CachedFunction

%o def T(n,k): # T = A026552

%o if (k==0 or k==2*n): return 1

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

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

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

%o flatten([[T(n,k) for k in (0..2*n)] for n in (0..10)]) # _G. C. Greubel_, Dec 17 2021

%Y Cf. A026553, A026554, A026555, A026556, A026557, A026558, A026559, A026560, A026563, A026563, A026566, A026567, A027272, A027273, A027274, A027275, A027276.

%Y Cf. A026519, A026536, A026568, A026584, A027926.

%Y Cf. A026565.

%K nonn,tabf

%O 0,6

%A _Clark Kimberling_

%E Updated by _Clark Kimberling_, Aug 28 2014

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 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)