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.

A366191 Enumeration of the rational numbers in the closed real interval [0, 1] after Cantor.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 3, 1, 4, 2, 3, 1, 5, 1, 6, 2, 5, 3, 4, 1, 7, 3, 5, 1, 8, 2, 7, 4, 5, 1, 9, 3, 7, 1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 1, 11, 5, 7, 1, 12, 2, 11, 3, 10, 4, 9, 5, 8, 6, 7, 1, 13, 3, 11, 5, 9, 1, 14, 2, 13, 4, 11, 7, 8, 1, 15, 3, 13, 5, 11, 7, 9
Offset: 1

Views

Author

Peter Luschny, Oct 10 2023

Keywords

Comments

The rational numbers in the interval [0, 1] are listed as pairs of relatively prime integers a(2*n-1) / a(2*n).
Start with (0, 1). Then append pairs (t, n - t) where t and n - t are relatively prime positive integers and 1 <= t <= floor(n/2). Sort first by n then by t in ascending order.

Examples

			Seen as an irregular table:
   1: [0,  1],
   2: [1,  1],
   3: [1,  2],
   4: [1,  3],
   5: [1,  4], [2, 3],
   6: [1,  5],
   7: [1,  6], [2, 5], [3, 4],
   8: [1,  7], [3, 5],
   9: [1,  8], [2, 7], [4, 5],
  10: [1,  9], [3, 7],
  11: [1, 10], [2, 9], [3, 8], [4, 7], [5, 6],
  ...
		

Crossrefs

Cf. A352911, A333856 (numerators only).
Essentially, A182972/A182973 give the numerators/denominators separately.

Programs

  • Maple
    A366191List := proc(upto) local C, F, n, t, count;
    C := [0, 1]; count := 0:
    for n from 2 while count < upto do
        F := select(t -> igcd(t, n - t) = 1, [$1..iquo(n,2)]);
        C := C, seq([t, n - t], t = F);
        count := count + nops(F) od;
    ListTools:-Flatten([C]) end:
    A366191List(40);
  • Mathematica
    A366191row[n_] := If[n == 1, {0, 1}, Select[Array[{#, n - #}&, Floor[n/2]], CoprimeQ[First[#], Last[#]]&]];
    Array[A366191row, 20] (* Paolo Xausa, Jan 16 2024 *)