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!)
A057431 Obtained by reading first the numerator then the denominator of fractions in full Stern-Brocot tree (A007305/A047679). 3

%I #23 Sep 06 2022 05:59:00

%S 0,1,1,0,1,1,1,2,2,1,1,3,2,3,3,2,3,1,1,4,2,5,3,5,3,4,4,3,5,3,5,2,4,1,

%T 1,5,2,7,3,8,3,7,4,7,5,8,5,7,4,5,5,4,7,5,8,5,7,4,7,3,8,3,7,2,5,1,1,6,

%U 2,9,3,11,3,10,4,11,5,13,5,12,4,9,5,9,7,12,8,13,7,11,7,10,8,11,7,9,5,6,6,5

%N Obtained by reading first the numerator then the denominator of fractions in full Stern-Brocot tree (A007305/A047679).

%C 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

%H Alois P. Heinz, <a href="/A057431/b057431.txt">Table of n, a(n) for n = 0..10000</a>

%H N. J. A. Sloane, <a href="/stern_brocot.html">Stern-Brocot or Farey Tree</a>

%H <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>

%p F:= proc(n) option remember; local t;

%p t:= L -> [[L[1], [L[1][1]+L[2][1], L[1][2]+L[2][2]], L[2]],

%p [L[2], [L[2][1]+L[3][1], L[2][2]+L[3][2]], L[3]]][];

%p if n=0 then [[[ ], [0, 1], [ ]], [[ ], [1, 0], [ ]]]

%p elif n=1 then [[[0, 1], [1, 1], [1, 0]]]

%p else map(t, F(n-1))

%p fi

%p end:

%p aa:= n-> map(x-> x[], [seq(map(x-> x[2], F(j))[], j=0..n)])[]:

%p aa(7); # aa(n) gives the first 2^(n+1)+2 terms

%p # _Alois P. Heinz_, Jan 13 2011

%t sbt[n_] := Module[{R, L, Y, w, u},

%t R = {{1, 0}, {1, 1}};

%t L = {{1, 1}, {0, 1}};

%t Y = {{1, 0}, {0, 1}};

%t w[b_] := Fold[#1.If[#2 == 0, L, R]&, Y, b];

%t u[a_] := {a[[2, 1]] + a[[2, 2]], a[[1, 1]] + a[[1, 2]]};

%t Map[u, Map[w, Tuples[{0, 1}, n]]]];

%t Join[{0, 1, 1, 0}, Table[sbt[n], {n, 0, 5}]] // Flatten (* _Jean-François Alcover_, Sep 06 2022, after _Peter Luschny_ in A007305 *)

%Y Cf. A007305, A047679, A007306, A002487, A057432.

%K nonn,look,easy

%O 0,8

%A _N. J. A. Sloane_, Sep 08 2000

%E More terms from _Joshua Zucker_, May 11 2006

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 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)