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.

A062704 Di-Boustrophedon transform of all 1's sequence: Fill in an array by diagonals alternating in the 'up' and 'down' directions. Each diagonal starts with a 1. When going in the 'up' direction the next element is the sum of the previous element of the diagonal and the previous two elements of the row the new element is in. When going in the 'down' direction the next element is the sum of the previous element of the diagonal and the previous two elements of the column the new element is in. The final element of the n-th diagonal is a(n).

This page as a plain text file.
%I A062704 #16 Mar 11 2022 12:00:44
%S A062704 1,2,5,13,40,145,616,3017,16752,103973,713040,5352729,43645848,
%T A062704 384059537,3626960272,36585357429,392545057280,4463791225145,
%U A062704 53622168102640,678508544425721,9020035443775264,125684948107190045,1831698736650660952,27866044704218390113
%N A062704 Di-Boustrophedon transform of all 1's sequence: Fill in an array by diagonals alternating in the 'up' and 'down' directions. Each diagonal starts with a 1. When going in the 'up' direction the next element is the sum of the previous element of the diagonal and the previous two elements of the row the new element is in. When going in the 'down' direction the next element is the sum of the previous element of the diagonal and the previous two elements of the column the new element is in. The final element of the n-th diagonal is a(n).
%H A062704 Alois P. Heinz, <a href="/A062704/b062704.txt">Table of n, a(n) for n = 1..200</a>
%e A062704 The array begins:
%e A062704    1   2   1  13   1
%e A062704    1   3  10  14
%e A062704    5   6  25
%e A062704    1  34
%e A062704   40
%p A062704 T:= proc(n, k) option remember;
%p A062704       if n<1 or k<1 then 0
%p A062704     elif n=1 and irem(k, 2)=1 or k=1 and irem(n, 2)=0 then 1
%p A062704     elif irem(n+k, 2)=0 then T(n-1, k+1)+T(n-1, k)+T(n-2, k)
%p A062704                         else T(n+1, k-1)+T(n, k-1)+T(n, k-2)
%p A062704       fi
%p A062704     end:
%p A062704 a:= n-> `if`(irem (n, 2)=0, T(1, n), T(n, 1)):
%p A062704 seq(a(n), n=1..30);  # _Alois P. Heinz_, Feb 08 2011
%t A062704 T[n_, k_] := T[n, k] = Which[n < 1 || k < 1, 0
%t A062704      , n == 1 && Mod[k, 2] == 1 || k == 1 && Mod[n, 2] == 0, 1
%t A062704      , Mod[n + k, 2] == 0, T[n - 1, k + 1] + T[n - 1, k] + T[n - 2, k]
%t A062704      , True,               T[n + 1, k - 1] + T[n, k - 1] + T[n, k - 2]];
%t A062704 a[n_] := If[Mod [n, 2] == 0, T[1, n], T[n, 1]];
%t A062704 Table[a[n], {n, 1, 30}] (* _Jean-François Alcover_, Mar 11 2022, after _Alois P. Heinz_ *)
%Y A062704 Cf. A000667, A059216, A063179.
%K A062704 easy,nonn
%O A062704 1,2
%A A062704 _Floor van Lamoen_, Jul 11 2001
%E A062704 More terms from _Alois P. Heinz_, Feb 08 2011