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.

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.

Original entry on oeis.org

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

Views

Author

John W. Layman, Feb 06 2002

Keywords

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

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
		

Crossrefs

See A066720 for a somewhat similar sequence.

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.