login
Triangle read by rows: this is a variant of A008280 in which 2 rows go from left to right, 2 from right to left, 2 from left to right, etc.
5

%I #15 Feb 18 2021 00:43:13

%S 1,0,1,0,0,1,1,1,1,0,3,2,1,0,0,0,3,5,6,6,6,0,0,3,8,14,20,26,71,71,71,

%T 68,60,46,26,0,413,342,271,200,132,72,26,0,0,0,413,755,1026,1226,1358,

%U 1430,1456,1456,1456,0,0,413,1168,2194,3420,4778,6208,7664,9120,10576

%N Triangle read by rows: this is a variant of A008280 in which 2 rows go from left to right, 2 from right to left, 2 from left to right, etc.

%C Suggested by Atkinson article in Information Processing Letters.

%D M. D. Atkinson, Partial orders and comparison problems, Sixteenth Southeastern Conference on Combinatorics, Graph Theory and Computing, (Boca Raton, Feb 1985), Congressus Numerantium 47, 77-88.

%H Reinhard Zumkeller, <a href="/A058257/b058257.txt">Rows n = 0..120 of triangle, flattened</a>

%H M. D. Atkinson, <a href="https://doi.org/10.1016/0020-0190(85)90057-2">Zigzag permutations and comparisons of adjacent elements</a>, Information Processing Letters 21 (1985), 187-189.

%H J. Millar, N. J. A. Sloane and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory, 17A (1996), 44-54 (<a href="http://neilsloane.com/doc/bous.txt">Abstract</a>, <a href="http://neilsloane.com/doc/bous.pdf">pdf</a>, <a href="http://neilsloane.com/doc/bous.ps">ps</a>).

%H <a href="/index/Bo#boustrophedon">Index entries for sequences related to boustrophedon transform</a>

%e Triangle begins:

%e 1;

%e 0, 1;

%e 0, 0, 1;

%e 1, 1, 1, 0;

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

%e 0, 3, 5, 6, 6, 6;

%e ...

%o (Haskell)

%o a058257 n k = a058257_tabl !! n !! k

%o a058257_row n = a058257_tabl !! n

%o a058257_tabl = [1] : ox 0 [1] where

%o ox turn xs = ys : ox (mod (turn + 1) 4) ys

%o where ys | turn <= 1 = scanl (+) 0 xs

%o | otherwise = reverse $ scanl (+) 0 $ reverse xs

%o -- _Reinhard Zumkeller_, Nov 01 2013

%Y Cf. A058258, A008280, A000111.

%K nonn,easy,tabl,nice

%O 0,11

%A _N. J. A. Sloane_, Dec 06 2000

%E More terms from Larry Reeves (larryr(AT)acm.org), Dec 12 2000