login
Integer parts of the full Stern-Brocot tree.
3

%I #33 Nov 19 2021 05:00:52

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

%T 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,6,0,0,0,0,

%U 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1

%N Integer parts of the full Stern-Brocot tree.

%H Jon Maiga, <a href="http://sequencedb.net/s/A153036">Computer-generated formulas for A153036</a>, Sequence Machine.

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

%F a(n+1) = floor(A007305(n+2)/A047679(n)). [Corrected by _Andrey Zabolotskiy_, Jul 23 2020]

%F a(n) = if n=2^k-1 then k else Log2(n)-1-Log2(2^(Log2(n)+1)-(n+1)), where Log2=A000523.

%F From _Andrey Zabolotskiy_, Oct 07 2021: (Start)

%F Formulas discovered by Sequence Machine (and also essentially by _Kevin Ryde_):

%F a(n) = A090996(n) - A043545(n).

%F a(n) = A007814(A145342(n+1)). (End)

%e a(1): 1;

%e a(2..3): 1x0, 2;

%e a(4..7): 2x0, 1x1, 3;

%e a(8..15): 4x0, 2x1, 1x2, 4;

%e a(16..31): 8x0, 4x1, 2x2, 1x3, 5;

%e a(32..63): 16x0, 8x1, 4x2, 2x3, 1x4, 6;

%e a(64..127): 32x0, 16x1, 8x2, 4x3, 2x4, 1x5, 7;

%e a(128..255): 64x0, 32x1, 16x2, 8x3, 4x4, 2x5, 1x6, 8;

%e a(256..511): 128x0, 64x1, 32x2, 16x3, 8x4, 4x5, 2x6, 1x7, 9.

%Y Cf. A130321.

%Y If every block of terms of length 2^k is reversed, we get A290256; other permutations within these blocks give A007814 and A272729-1.

%Y Cf. A090996, A043545, A007814, A145342.

%K nonn,tabf

%O 0,4

%A _Reinhard Zumkeller_, Dec 22 2008

%E a(0) = 0 added by _Andrey Zabolotskiy_, Jul 23 2020