|
| |
|
|
A047679
|
|
Denominator in full Stern-Brocot tree.
|
|
21
| |
|
|
1, 2, 1, 3, 3, 2, 1, 4, 5, 5, 4, 3, 3, 2, 1, 5, 7, 8, 7, 7, 8, 7, 5, 4, 5, 5, 4, 3, 3, 2, 1, 6, 9, 11, 10, 11, 13, 12, 9, 9, 12, 13, 11, 10, 11, 9, 6, 5, 7, 8, 7, 7, 8, 7, 5, 4, 5, 5, 4, 3, 3, 2, 1, 7, 11, 14, 13, 15, 18, 17, 13, 14, 19, 21, 18, 17, 19, 16, 11, 11, 16, 19, 17, 18
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 0,2
|
|
|
COMMENTS
| Write n in binary; list run lengths; add 1 to last run length; make into continued fraction. Sequence gives denominator of fraction obtained.
Contribution from Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 22 2008: (Start)
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))+0 else 1+a(A025480(n-1));
a(n) = A007305(A054429(n)+2) and a(A054429(n)) = A007305(n+2);
A153036(n) = floor(A007305(n+2)/a(n)). (End)
|
|
|
LINKS
| N. J. A. Sloane, Stern-Brocot or Farey Tree
Index entries for sequences related to Stern's sequences
Alois P. Heinz, Table of n, a(n) for n = 0..10000
|
|
|
FORMULA
| a(n) = SternBrocotTreeDen(n) # n starting from 1.
|
|
|
EXAMPLE
| E.g. 57->111001->[ 3,2,1 ]->[ 3,2,2 ]->3 + 1/(2 + 1/(2) ) = 17/2. For n=1,2,... we get 2, 3/2, 3, 4/3, 5/3, 5/2, 4, 5/4, 7/5, 8/5,...
1; 2,1; 3,3,2,1; 4,5,5,4,3,3,2,1; ....
|
|
|
MAPLE
| SternBrocotTreeDen := n -> SternBrocotTreeNum(((3*(2^floor_log_2(n)))-n)-1); # SternBrocotTreeNum given in A007305 and (((3*(2^floor_log_2(n)))-n)-1) is equal to A054429[n].
|
|
|
MATHEMATICA
| Needs[ "NumberTheory`ContinuedFractions`" ]; CFruns[ n_Integer ] := Fold[ #2+1/#1&, \[ Infinity ], Reverse[ MapAt[ #+1&, Length/@Split[ IntegerDigits[ n, 2 ] ], {-1} ] ] ]
|
|
|
CROSSREFS
| Numerators are A007305. Cf. A054424.
A152976. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 22 2008]
Sequence in context: A121436 A088074 A071463 * A179480 A035050 A198790
Adjacent sequences: A047676 A047677 A047678 * A047680 A047681 A047682
|
|
|
KEYWORD
| nonn,easy,frac,nice,tabf
|
|
|
AUTHOR
| Wouter Meeussen (wouter.meeussen(AT)pandora.be)
|
| |
|
|