A067992 a(0)=1 and, for n > 0, a(n) is the smallest positive integer such that the ratios min(a(k)/a(k-1), a(k-1)/a(k)) for 0 < k <= n are all distinct.
1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 5, 2, 7, 1, 8, 3, 7, 4, 5, 7, 6, 11, 1, 9, 2, 11, 3, 10, 1, 12, 5, 8, 7, 9, 4, 11, 5, 9, 8, 11, 7, 10, 9, 11, 10, 13, 1, 14, 3, 13, 2, 15, 1, 16, 3, 17, 1, 18, 5, 13, 4, 15, 7, 12, 11, 13, 6, 17, 2, 19, 1, 20, 3, 19, 4, 17, 5, 14, 9, 13, 7, 16, 5, 19, 6, 23, 1, 21, 2
Offset: 0
Examples
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
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).
Programs
-
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 *)
-
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
Formula
a(6)=3, since 1/4 and 2/4 = 1/2 have already occurred as ratios of adjacent terms.
Comments