OFFSET
0,3
COMMENTS
Every positive rational number appears exactly once as the ratio of adjacent terms (in either order). Conjecture: adjacent terms are always relatively prime. - Franklin T. Adams-Watters, Sep 13 2006
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
Neil Calkin and Herbert S. Wilf, Recounting the rationals, The American Mathematical Monthly, Vol. 107, No. 4 (2000), 360-363.
Neil Calkin and Herbert S. Wilf, Recounting the rationals, Fermat's Library (2008).
FORMULA
a(6)=3, since 1/4 and 2/4 = 1/2 have already occurred as ratios of adjacent terms.
EXAMPLE
The sequence of all rational numbers between 0 and 1 obtained by taking ratios of sorted consecutive terms begins: 1/2, 2/3, 1/3, 1/4, 3/4, 3/5, 1/5, 1/6, 5/6, 2/5, 2/7, 1/7, 1/8, 3/8, 3/7, 4/7, 4/5, 5/7, 6/7. - Gus Wiseman, Aug 30 2018
MATHEMATICA
Nest[Function[seq, Append[seq, NestWhile[#+1&, 1, MemberQ[Divide@@@Sort/@Partition[seq, 2, 1], Min[Last[seq]/#, #/Last[seq]]]&]]], {1}, 100] (* Gus Wiseman, Aug 30 2018 *)
PROG
(PARI) seen = Set([]); other(p) = for (v=1, oo, my (r = min(v, p)/max(v, p)); if (!set search(seen, r), seen = set union(seen, Set([r])); return (v)))
for (n=0, 88, v = if (n==0, 1, other(v)); print1 (v ", ")) \\ Rémy Sigrist, Aug 07 2017
CROSSREFS
AUTHOR
John W. Layman, Feb 06 2002
STATUS
approved