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.

A350391 The largest denominator that can be made from n repeated applications of the maps f(x) = x + 1 or g(x) = -1/x, starting from 0.

This page as a plain text file.
%I A350391 #45 Dec 25 2024 00:51:08
%S A350391 1,1,1,2,3,4,5,6,8,11,15,19,24,30,41,56,72,91,115,153,209,269,345,436,
%T A350391 571,780,1005,1292,1653,2131,2911,3751,4827,6191,7953,10864,14000,
%U A350391 18034,23184,29681,40545,52249,67320,86617,111097,151316,194997
%N A350391 The largest denominator that can be made from n repeated applications of the maps f(x) = x + 1 or g(x) = -1/x, starting from 0.
%C A350391 Every rational number can be generated by repeated applications of the maps f(x) = x + 1 and g(x) = -1/x.
%C A350391 For n > 0, a(n) is the maximum entry in row n of A226247.
%H A350391 Code Golf Stack Exchange, <a href="https://codegolf.stackexchange.com/q/240806/53884">Iterate your way to a fraction</a>.
%H A350391 Tom Davis, <a href="http://www.geometer.org/mathcircles/tangle.pdf">Conway's Rational Tangles</a>.
%e A350391 For n = 0, a(0) = 1 because  0/1 = 0.
%e A350391 For n = 1, a(1) = 1 because  1/1 = f(0).
%e A350391 For n = 2, a(2) = 1 because  2/1 = f(f(0)).
%e A350391 For n = 3, a(3) = 2 because -1/2 = g(f(f(0))).
%e A350391 For n = 4, a(4) = 3 because -1/3 = g(f(f(f(0)))).
%e A350391 For n = 5, a(5) = 4 because -1/4 = g(f(f(f(f(0))))).
%e A350391 For n = 6, a(6) = 5 because -1/5 = g(f(f(f(f(f(0)))))).
%e A350391 For n = 7, a(7) = 6 because -1/6 = g(f(f(f(f(f(f(0))))))).
%e A350391 For n = 8, a(8) = 8 because -3/8 = g(f(f(f(g(f(f(f(0)))))))).
%o A350391 (Python)
%o A350391 from fractions import Fraction
%o A350391 from itertools import count, islice
%o A350391 def agen():
%o A350391     rats = {Fraction(0, 1)}
%o A350391     for n in count(1):
%o A350391         yield max(r.denominator for r in rats)
%o A350391         newrats = set()
%o A350391         for r in rats:
%o A350391             newrats.add(1+r)
%o A350391             if r != 0:
%o A350391                 newrats.add(-1/r)
%o A350391         rats = newrats
%o A350391 print(list(islice(agen(), 25))) # _Michael S. Branicky_, Jan 17 2022
%Y A350391 Cf. A226247, A226248, A226249, A226250.
%K A350391 nonn
%O A350391 0,4
%A A350391 _Peter Kagey_, Jan 10 2022
%E A350391 a(42)-a(46) from _Michael S. Branicky_, Jan 17 2022