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.

A326538 a(n) is the numerator of the image of 1/n by the Cantor staircase function.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 3, 3, 3, 3, 23, 1, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 1, 7, 7
Offset: 1

Views

Author

Rémy Sigrist, Jul 12 2019

Keywords

Comments

The Cantor staircase function, say c, maps rational numbers in the interval [0..1] to rational numbers in the interval [0..1], hence this sequence is well defined.
For any n > 0, the binary expansion of c(1/n) is terminating (and A326539(n) is a power of 2) iff the ternary expansion of 1/n is terminating or contains a digit 1.

Examples

			The first terms, alongside c(1/n) and the ternary and binary representation of 1/n and c(1/n), respectively, with periodic part in parentheses, are:
  n   a(n)  c(1/n)  ter(1/n)                bin(c(1/n))
  --  ----  ------  ----------------------  -----------
   1     1       1  1.(0)                   1.(0)
   2     1     1/2  0.(1)                   0.1(0)
   3     1     1/2  0.1(0)                  0.1(0)
   4     1     1/3  0.(02)                  0.(01)
   5     1     1/4  0.(0121)                0.01(0)
   6     1     1/4  0.0(1)                  0.01(0)
   7     1     1/4  0.(010212)              0.01(0)
   8     1     1/4  0.(01)                  0.01(0)
   9     1     1/4  0.01(0)                 0.01(0)
  10     1     1/5  0.(0022)                0.(0011)
  11     3    3/16  0.(00211)               0.0011(0)
  12     1     1/6  0.0(02)                 0.0(01)
  13     1     1/7  0.(002)                 0.(001)
  14     1     1/8  0.(001221)              0.001(0)
  15     1     1/8  0.0(0121)               0.001(0)
  16     1     1/8  0.(0012)                0.001(0)
  17     1     1/8  0.(0011202122110201)    0.001(0)
  18     1     1/8  0.00(1)                 0.001(0)
  19     1     1/8  0.(001102100221120122)  0.001(0)
  20     1     1/8  0.(0011)                0.001(0)
		

Crossrefs

See A326539 for the corresponding denominators.
Cf. A061392.

Programs

  • PARI
    See Links section.