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.

A295512 The Euclid tree with root 1 encoded by semiprimes, read across levels.

Original entry on oeis.org

4, -6, 6, -21, 35, -35, 21, -10, 221, -77, 55, -55, 77, -221, 10, -33, 46513, -493, 377, -119, 187, -1333, 559, -559, 1333, -187, 119, -377, 493, -46513, 33, -14, 143, -209, 629, -14527, 2881, -1189, 533, -161, 391, -15229, 2449, -2263, 3139, -1073, 95, -95
Offset: 1

Views

Author

Peter Luschny, Nov 23 2017

Keywords

Comments

The Euclid tree with root 1 is A295515 (sometimes called Calkin-Wilf tree).
For a positive rational r we use the Schinzel-Sierpiński encoding r -> [p, q] as described in A295511 and encode r as sgn*p*q where sgn is -1 if r < 1, else +1.
Apart from a(1) all terms are squarefree.

Examples

			The tree starts:
                     4
            -6                 6
       -21       35      -35       21
    -10  221  -77  55  -55  77  -221  10
		

References

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

Crossrefs

Programs

  • Maple
    EuclidTree := proc(n) local k, DijkstraFusc;
    DijkstraFusc := proc(m) option remember; local a, b, n; a := 1; b := 0; n := m;
    while n > 0 do if type(n, odd) then b := a+b else a := a+b fi; n := iquo(n,2) od; b end:
    seq(DijkstraFusc(k)/DijkstraFusc(k+1), k=2^(n-1)..2^n-1) end:
    SchinzelSierpinski := proc(l) local a, b, r, p, q, sgn;
    a := numer(l); b := denom(l); q := 2; sgn := `if`(a < b, -1, 1);
    while q < 1000000000 do r := a*(q - 1); if r mod b = 0 then p := r/b + 1;
    if isprime(p) then return(sgn*p*q) fi fi; q := nextprime(q); od;
    print("Search limit reached!", a, b) end:
    Tree := level -> seq(SchinzelSierpinski(l), l=EuclidTree(level)): seq(Tree(n), n=1..6);