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.

A084337 Rearrangement of positive integers so that the successive ratios (of the larger to the smaller term) are all distinct integers. a(m)/a(m-1) = a(k)/a(k-1) iff m = k (assuming a(m) > a(m-1), otherwise the ratio a(m-1)/a(m) is to be considered). Priority is given to smallest number not included earlier rather than to the successive ratio that has not occurred earlier.

This page as a plain text file.
%I A084337 #19 Mar 18 2024 09:47:04
%S A084337 1,2,6,24,3,15,90,5,35,315,7,70,770,10,120,4,52,728,8,128,1920,12,204,
%T A084337 3876,17,340,7140,14,308,11,253,6072,22,550,14300,13,351,9,261,8091,
%U A084337 29,928,16,528,17952,32,1120,20,720,18,666,25308,19,779,32718,21,903,39732
%N A084337 Rearrangement of positive integers so that the successive ratios (of the larger to the smaller term) are all distinct integers. a(m)/a(m-1) = a(k)/a(k-1) iff m = k (assuming a(m) > a(m-1), otherwise the ratio a(m-1)/a(m) is to be considered). Priority is given to smallest number not included earlier rather than to the successive ratio that has not occurred earlier.
%C A084337 The sequence of successive ratios is 2/1, 6/2, 24/6, 24/3, 15/3, 90/15, 90/9, 63/9, 63/7, ... or 2, 3, 4, 8, 5, 6, 10, 7, 9, ...
%H A084337 Michael S. Branicky, <a href="/A084337/b084337.txt">Table of n, a(n) for n = 0..10000</a> (0..5000 from Ivan Neretin)
%t A084337 a = r = {1}; Do[If[(ds = Select[Divisors[a[[-1]]], ! MemberQ[a, #] && ! MemberQ[r, a[[-1]]/#] &, 1]) != {}, nxta = ds[[1]]; nxtr = a[[-1]]/nxta, k = 1; While[MemberQ[r, k] || MemberQ[a, a[[-1]]*k], k++]; nxtr = k; nxta = k*a[[-1]]]; AppendTo[a, nxta]; AppendTo[r, nxtr], {n, 57}]; a (* _Ivan Neretin_, Jul 05 2015 *)
%o A084337 (Python)
%o A084337 from sympy import divisors
%o A084337 from itertools import islice
%o A084337 def agen(): # generator of terms
%o A084337     mina, an, aset, mink, kset = 1, 1, {1}, 1, set()
%o A084337     while True:
%o A084337         yield an
%o A084337         k1, ak1, k2 = 0, mina, mink
%o A084337         if mina < an:
%o A084337             for d in divisors(an):
%o A084337                 if d not in aset and an//d not in kset:
%o A084337                     k1 = an//d
%o A084337                     break
%o A084337         while k2 in kset or an*k2 in aset:
%o A084337             k2 += 1
%o A084337         an, k = (an//k1, k1) if k1 > 0 else (an*k2, k2)
%o A084337         aset.add(an)
%o A084337         kset.add(k)
%o A084337         while mina in aset: mina += 1
%o A084337         while mink in kset: mink += 1
%o A084337 print(list(islice(agen(), 58))) # _Michael S. Branicky_, Mar 18 2024
%K A084337 nonn
%O A084337 0,2
%A A084337 _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 18 2003
%E A084337 Corrected and extended by _David Wasserman_, Dec 15 2004