cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A059216 Variation of Boustrophedon transform applied to all-1's sequence (see Comments for details).

This page as a plain text file.
%I A059216 #19 Dec 31 2016 01:04:27
%S A059216 1,2,5,14,45,169,740,3721,21142,133850,933770,7114115,58758459,
%T A059216 522892624,4987285553,50751731950,548839590949,6285265061237,
%U A059216 75985249771496,967047685739501,12923640789599709,180945893711983990,2648725169100050894
%N A059216 Variation of Boustrophedon transform applied to all-1's sequence (see Comments for details).
%C A059216 Variation of Boustrophedon transform applied to all-1's sequence. Fill an array by diagonals in alternating directions - 'up' and 'down'. The first element of each diagonal is 1. When 'going up', add to the previous element the elements of the row the new element is in. When 'going down', add to the previous element the elements of the column the new element is in. The final element of the n-th diagonal is a(n).
%H A059216 G. C. Greubel, <a href="/A059216/b059216.txt">Table of n, a(n) for n = 1..480</a>
%H A059216 <a href="/index/Bo#boustrophedon">Index entries for sequences related to boustrophedon transform</a>
%e A059216 The array begins
%e A059216    1  2  1 14  1 ...
%e A059216    1  3 10 15 ...
%e A059216    5  6 26 ...
%e A059216    1 37 ...
%e A059216   45 ...
%p A059216 # To get the array used to produce this sequence:
%p A059216 aaa := proc(m,n) option remember; local i,j,r,s,t1; if m=0 and n=0 then RETURN(1); fi; if n = 0 and m mod 2 = 1 then RETURN(1); fi; if m = 0 and n mod 2 = 0 then RETURN(1); fi; s := m+n; if s mod 2 = 1 then t1 := aaa(m+1,n-1); for j from 0 to n-1 do t1 := t1+aaa(m,j); od: else t1 := aaa(m-1,n+1); for j from 0 to m-1 do t1 := t1+aaa(j,n); od: fi; RETURN(t1); end; # the n-th antidiagonal in the up direction is aaa(n,0), aaa(n-1,1), aaa(n-2,2), ..., aaa(0,n)
%p A059216 # To get the array formed when the transformation is applied to an arbitrary input sequence b = [b[1], b[2], ..., b[N]]:
%p A059216 aab := proc(b,N,m,n) local i, j, r, s, t1; option remember; if m>N or n>N then error "asking for too many terms"; fi; if m = 0 and n mod 2 = 0 then RETURN(b[n+1]) end if; if n = 0 and m mod 2 = 1 then RETURN(b[m+1]) end if; s := m + n; if s mod 2 = 1 then t1 := aab(b,N,m + 1, n - 1); for j from 0 to n - 1 do t1 := t1 + aab(b,N,m, j) end do else t1 := aab(b,N,m - 1, n + 1); for j from 0 to m - 1 do t1 := t1 + aab(b,N,j, n) end do end if; RETURN(t1) end proc;
%p A059216 # To get the output sequence when the transformation is applied to an arbitrary input sequence b = [b[1], b[2], ..., b[N]]:
%p A059216 ff := proc(b) local N,t1,i; N := min(35, nops(b)); t1 := []; for i from 0 to N-1 do if i mod 2 = 0 then t1 := [op(t1),aab(b,N,i,0)]; else t1 := [op(t1),aab(b,N,0,i)]; fi; od: t1; end;
%t A059216 max = 22; t[0, 0] = 1; t[0, _?EvenQ] = 1; t[_?OddQ, 0] = 1; t[n_, k_] /; OddQ[n + k](*up*):= t[n, k] = t[n + 1, k - 1] + Sum[t[n, j], {j, 0, k - 1}]; t[n_, k_] /; EvenQ[n + k](*down*):= t[n, k] = t[n - 1, k + 1] + Sum[t[j, k], {j, 0, n - 1}]; tnk = Table[t[n, k], {n, 0, max}, {k, 0, max - n}]; Join[{1}, Rest[Union[tnk[[1]], tnk[[All, 1]]]]] (* _Jean-François Alcover_, Jun 15 2012 *)
%Y A059216 Cf. A000667, A059217, A059219, A059220, A059718.
%K A059216 easy,nonn,nice
%O A059216 1,2
%A A059216 _Floor van Lamoen_, Jan 18 2001
%E A059216 More terms from _N. J. A. Sloane_ and Larry Reeves (larryr(AT)acm.org), Jan 23 2001