OFFSET
0,8
COMMENTS
When presented in this way, every row (e.g. row 3, 1 3 2 3 3 2 3 1) is a palindrome. - Joshua Zucker, May 11 2006
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
N. J. A. Sloane, Stern-Brocot or Farey Tree
MAPLE
F:= proc(n) option remember; local t;
t:= L -> [[L[1], [L[1][1]+L[2][1], L[1][2]+L[2][2]], L[2]],
[L[2], [L[2][1]+L[3][1], L[2][2]+L[3][2]], L[3]]][];
if n=0 then [[[ ], [0, 1], [ ]], [[ ], [1, 0], [ ]]]
elif n=1 then [[[0, 1], [1, 1], [1, 0]]]
else map(t, F(n-1))
fi
end:
aa:= n-> map(x-> x[], [seq(map(x-> x[2], F(j))[], j=0..n)])[]:
aa(7); # aa(n) gives the first 2^(n+1)+2 terms
# Alois P. Heinz, Jan 13 2011
MATHEMATICA
sbt[n_] := Module[{R, L, Y, w, u},
R = {{1, 0}, {1, 1}};
L = {{1, 1}, {0, 1}};
Y = {{1, 0}, {0, 1}};
w[b_] := Fold[#1.If[#2 == 0, L, R]&, Y, b];
u[a_] := {a[[2, 1]] + a[[2, 2]], a[[1, 1]] + a[[1, 2]]};
Map[u, Map[w, Tuples[{0, 1}, n]]]];
Join[{0, 1, 1, 0}, Table[sbt[n], {n, 0, 5}]] // Flatten (* Jean-François Alcover, Sep 06 2022, after Peter Luschny in A007305 *)
CROSSREFS
KEYWORD
AUTHOR
N. J. A. Sloane, Sep 08 2000
EXTENSIONS
More terms from Joshua Zucker, May 11 2006
STATUS
approved