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.

A309786 a(n) is the length of the cycle of the trajectory of 1/n under the map f(x) = min(2*x, 2-2*x).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 1, 3, 2, 5, 1, 6, 3, 4, 1, 4, 3, 9, 2, 6, 5, 11, 1, 10, 6, 9, 3, 14, 4, 5, 1, 5, 4, 12, 3, 18, 9, 12, 2, 10, 6, 7, 5, 12, 11, 23, 1, 21, 10, 8, 6, 26, 9, 20, 3, 9, 14, 29, 4, 30, 5, 6, 1, 6, 5, 33, 4, 22, 12, 35, 3, 9, 18, 20, 9, 30, 12
Offset: 1

Views

Author

Rémy Sigrist, Aug 17 2019

Keywords

Comments

For any rational number q in the interval [0, 1]:
- f(q) is rational and lies in the interval [0, 1],
- denominator(f(q)) <= denominator(q),
- as there are only finitely many rational numbers whose denominator is less than or equal to that of q in the interval [0, 1],
- iteratively applying f to q eventually leads to a cycle,
- and the sequence is well defined.
For any irrational number x in the interval [0, 1]:
- f(x) is irrational and lies in the interval [0, 1],
- for any k > 0, as fixed points of the k-th iterate of f are rational,
- iteratively applying f to x never leads to a cycle.
As f is continuous on the interval [0, 1] and 1/7 has least period 3, according to the period three theorem, f has points of any period length, as well as chaotic points.

Examples

			For n = 5:
- f(1/5) = 2/5,
- f(2/5) = 4/5,
- f(4/5) = 2/5,
- hence a(5) = 2.
		

Crossrefs

Programs

  • PARI
    a(n, f=x -> min(2*x, 2-2*x)) = my (x=f(1/n), y=f(x)); while (x!=y, x=f(x); y=f(f(y))); for (k=1, oo, if (x==y=f(y), return (k)))

Formula

a(2*n-1) = A003558(n-1).
a(2*n) = a(n).
a(n) = 1 iff n belongs to A029744.
a(n) = 2 iff n belongs to A020714.