cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A295511 The Schinzel-Sierpiński tree of fractions, read across levels.

Original entry on oeis.org

2, 2, 2, 3, 3, 2, 3, 7, 7, 5, 5, 7, 7, 3, 2, 5, 17, 13, 7, 11, 11, 5, 5, 11, 11, 7, 13, 17, 5, 2, 3, 11, 241, 193, 17, 29, 29, 13, 7, 17, 17, 11, 31, 43, 43, 13, 13, 43, 43, 31, 11, 17, 17, 7, 13, 29, 29, 17, 193, 241, 11, 3
Offset: 1

Views

Author

Peter Luschny, Nov 23 2017

Keywords

Comments

A conjecture of Schinzel and Sierpiński asserts that every positive rational number r can be represented as a quotient of shifted primes such that r = (p-1)/(q-1).
The function r -> [p, q] will be called the Schinzel-Sierpiński encoding of r if q is the smallest prime such that r = (p-1)/(q-1) for some prime p. In the case that no pair of such primes exists we set by convention p = q = 1.
The Schinzel-Sierpiński tree of fractions is the Euclid tree A295515 with root 1 and fractions represented by the Schinzel-Sierpiński encoding.

Examples

			The tree starts:
                                        2/2
                   2/3                                     3/2
         3/7                  7/5                 5/7                   7/3
   2/5       17/13     7/11        11/5     5/11       11/7     13/17        5/2
.
The numerators of the terms written as an array (the denominators are given by reversion of the arrays):
1: 2
2: 2, 3
3: 3, 7, 5, 7
4: 2, 17, 7, 11, 5, 11, 13, 5
5: 3, 241, 17, 29, 7, 17, 31, 43, 13, 43, 11, 17, 13, 29, 193, 11
		

References

  • E. Dijkstra, Selected Writings on Computing, Springer, 1982, p. 232.

Crossrefs

Programs

  • Sage
    def EuclidTree(n): # with root 1
        def DijkstraFusc(m):
            a, b, k = 1, 0, m
            while k > 0:
                if k % 2 == 1: b += a
                else: a += b
                k = k >> 1
            return b
        DF = [DijkstraFusc(k) for k in (2^(n-1)..2^n)]
        return [DF[j]/DF[j+1] for j in (0..2^(n-1)-1)]
    def SchinzelSierpinski(l):
        a, b = l.numerator(), l.denominator()
        p, q = 1, 2
        while q < 1000000000: # search limit
            r = a*(q - 1)
            if b.divides(r):
                p = r // b + 1
                if is_prime(p): return p/q
            q = next_prime(q)
        print("Search limit reached for ", l); return 0
    def SSETree(level):
        return [SchinzelSierpinski(l) for l in EuclidTree(level)]
    # With the imperfection that Sage reduces 2/2 automatically to 1.
    for level in (1..6): print(SSETree(level))

A295515 The Euclid tree, read across levels.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Nov 25 2017

Keywords

Comments

Set N(x) = 1 + floor(x) - frac(x) and let '"' denote the ditto operator, referring to the previously computed expression. Assume the first expression is '0'. Then [0, repeat(N("))] will generate the natural numbers 0, 1, 2, 3, ... and [0, repeat(1/N("))] will generate the rational numbers 0/1, 1/1, 1/2, 2/1, 1/3, 3/2, ... Every reduced nonnegative rational number r appears exactly once in this list as a relatively prime pair [n, d] = r = n/d. We list numerator and denominator one after the other in the sequence.
The apt name 'Euclid tree' is taken from the exposition of Malter, Schleicher and Don Zagier. It is sometimes called the Calkin-Wilf tree. The enumeration is based on Stern's diatomic series (which is a subsequence) and computed by a modification of Dijkstra's 'fusc' function.
The tree listed has root 0, the variant with root 1 is more widely used. Seen as sequences the difference between the two trees is trivial: it is enough to leave out the first two terms; but as trees they are markedly different (see the example section).

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.

Crossrefs

Cf. A002487, A174981, A294446 (Stern-Brocot tree), A294442 (Kepler's tree), A295511 (Schinzel-Sierpiński tree), A295512 (encoded by semiprimes).

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,...
Sum_k Tp(n,k) 0,2,8,26,... A024023 1,3,9,27,... A000244
Sum_k Tq(n,k) 1,3,9,27,... A000244 1,3,9,27,... A000244
Sum_k 2Tr(n,k) 0,3,9,21,... A068156 2,5,11,23,... A083329
Sum_k Tp(n,k)Tq(n,k) 0,3,17,81,... A052913-1 1,4,18,82,... A052913
----
a(n) = A002487(floor(n/2)). - Georg Fischer, Nov 29 2022

A295510 The numerators of the fractions in the Schinzel-Sierpiński tree A295511, read across levels. Also an encoding of Stern's diatomic series A002487.

Original entry on oeis.org

2, 2, 3, 3, 7, 5, 7, 2, 17, 7, 11, 5, 11, 13, 5, 3, 241, 17, 29, 7, 17, 31, 43, 13, 43, 11, 17, 13, 29, 193, 11, 2, 13, 11, 37, 73, 67, 29, 41, 7, 23, 97, 79, 31, 73, 29, 19, 5, 37, 43, 73, 31, 157, 17, 23, 13, 41, 43, 199, 17, 19, 11, 7
Offset: 1

Views

Author

Peter Luschny, Nov 23 2017

Keywords

Examples

			The triangle (row lengths are 2^(n-1)) starts:
1: 2
2: 2, 3
3: 3, 7, 5, 7
4: 2, 17, 7, 11, 5, 11, 13, 5
5: 3, 241, 17, 29, 7, 17, 31, 43, 13, 43, 11, 17, 13, 29, 193, 11
		

Crossrefs

Programs

  • Sage
    # uses[SSETree from A295511]
    def A295510_row(n):
        if n == 1: return [2]
        return [r.numerator() for r in SSETree(n)]
    for n in (1..6): print(A295510_row(n))

A295509 Maxima of the numerators (and also of the denominators) of row n in the Schinzel-Sierpinski tree of fractions A295511.

Original entry on oeis.org

2, 3, 7, 17, 241, 199, 647, 1117, 4231, 8161, 15361, 28057, 67801, 308509, 263101, 515089, 1525921, 2103817, 3376459
Offset: 1

Views

Author

Peter Luschny, Nov 24 2017

Keywords

Crossrefs

Programs

Showing 1-4 of 4 results.