1,2

For all coprime pairs (u,v) with 1/3 < u/v < 2/3 exists a unique k such that a(k)=u and A153162(k)=v;

a(1) = 1 and for n>1: a(n) = if A025480(n-1)<>0 and A025480(n)<>0 then a(A025480(n-1))+a(A025480(n)) else if A025480(n)=0 then a(A025480(n-1))+2 else 1+a(A025480(n-1)).

Table of n, a(n) for n=1..82.

Index entries for sequences related to Stern's sequences

N. J. A. Sloane, Stern-Brocot or Farey Tree

{1/3} . . . . . . . . . . . . . . . . . . . . . . . {2/3}

.......................... 1/2 ..........................

............... 2/5 ................. 3/5 ...............

...... 3/8 .......... 3/7 ..... 4/7 .......... 5/8 ......

.. 4/11 .. 5/13 . 5/12 . 4/9 5/9 . 7/12 . 8/13 .. 7/11 .

A007305.

Sequence in context: A134841 A071112 A097087 * A238516 A282692 A269371

Adjacent sequences: A153158 A153159 A153160 * A153162 A153163 A153164

frac,nonn,tabf

Reinhard Zumkeller, Dec 22 2008

approved