A295515 The Euclid tree, read across levels.
0, 1, 1, 1, 1, 2, 2, 1, 1, 3, 3, 2, 2, 3, 3, 1, 1, 4, 4, 3, 3, 5, 5, 2, 2, 5, 5, 3, 3, 4, 4, 1, 1, 5, 5, 4, 4, 7, 7, 3, 3, 8, 8, 5, 5, 7, 7, 2, 2, 7, 7, 5, 5, 8, 8, 3, 3, 7, 7, 4, 4, 5, 5, 1, 1, 6, 6, 5, 5, 9, 9, 4, 4, 11, 11, 7, 7, 10, 10, 3, 3, 11, 11, 8, 8
Offset: 1
Keywords
Examples
The tree with root 0 starts: [0/1] [1/1, 1/2] [2/1, 1/3, 3/2, 2/3] [3/1, 1/4, 4/3, 3/5, 5/2, 2/5, 5/3, 3/4] [4/1, 1/5, 5/4, 4/7, 7/3, 3/8, 8/5, 5/7, 7/2, 2/7, 7/5, 5/8, 8/3, 3/7, 7/4, 4/5] . The tree with root 1 starts: [1/1] [1/2, 2/1] [1/3, 3/2, 2/3, 3/1] [1/4, 4/3, 3/5, 5/2, 2/5, 5/3, 3/4, 4/1] [1/5, 5/4, 4/7, 7/3, 3/8, 8/5, 5/7, 7/2, 2/7, 7/5, 5/8, 8/3, 3/7, 7/4, 4/5, 5/1]
References
- M. Aigner and G. M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 3rd ed., 2004.
Links
- Peter Luschny, Table of n, row(n) for n = 1..12
- N. Calkin and H. S. Wilf, Recounting the rationals, Amer. Math. Monthly, 107 (No. 4, 2000), pp. 360-363.
- Edsger Dijkstra, Selected Writings on Computing, Springer, 1982, p. 232. EWD 578: More about the function 'fusc'.
- Peter Luschny, Rational Trees and Binary Partitions.
- A. Malter, D. Schleicher, and D. Zagier, New looks at old number theory, Amer. Math. Monthly, 120(3), 2013, pp. 243-264.
- Moritz A. Stern, Über eine zahlentheoretische Funktion, J. Reine Angew. Math., 55 (1858), 193-220.
- Index entries for sequences related to enumerating the rationals
- Index entries for sequences related to trees
Crossrefs
Programs
-
Maple
# First implementation: use it only if you are not afraid of infinite loops. a := x -> 1/(1+floor(x)-frac(x)): 0; do a(%) od; # Second implementation: lusc := proc(m) local a, b, n; a := 0; b := 1; n := m; while n > 0 do if n mod 2 = 1 then b := a + b else a := a + b fi; n := iquo(n, 2) od; a end: R := n -> 3*2^(n-1)-1 .. 2^n: # The range of level n. EuclidTree_rat := n -> [seq(lusc(k+1)/lusc(k), k=R(n), -1)]: EuclidTree_num := n -> [seq(lusc(k+1), k=R(n), -1)]: EuclidTree_den := n -> [seq(lusc(k), k=R(n), -1)]: EuclidTree_pair := n -> ListTools:-Flatten([seq([lusc(k+1), lusc(k)], k=R(n), -1)]): seq(print(EuclidTree_pair(n)), n=1..5);
-
Sage
def A295515(n): if n == 1: return 0 M = [0, 1] for b in (n//2 - 1).bits(): M[b] = M[0] + M[1] return M[1] print([A295515(n) for n in (1..85)])
Formula
Some characteristics in comparison to the tree with root 1, seen as a table with T(n,k) for n >= 1 and 1 <= k <= 2^(n-1). Here Tr(n,k), Tp(n,k), Tq(n,k) denotes the fraction r, the numerator of r and the denominator of r in row n and column k respectively.
With root 0: With root 1:
Root Tr(1,1) 0/1 1/1
Tp(n,1) 0,1,2,3,... 1,1,1,1,...
Tp(n,2^(n-1)) 0,1,2,3,... 1,2,3,4,...
Tq(n,1) 1,1,1,1,... 1,2,3,4,...
Tq(n,2^(n-1)) 1,2,3,4,... 1,1,1,1,...
----
a(n) = A002487(floor(n/2)). - Georg Fischer, Nov 29 2022
Comments