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.
1, 2, 6, 24, 3, 15, 90, 5, 35, 315, 7, 70, 770, 10, 120, 4, 52, 728, 8, 128, 1920, 12, 204, 3876, 17, 340, 7140, 14, 308, 11, 253, 6072, 22, 550, 14300, 13, 351, 9, 261, 8091, 29, 928, 16, 528, 17952, 32, 1120, 20, 720, 18, 666, 25308, 19, 779, 32718, 21, 903, 39732
Offset: 0
Keywords
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..10000 (0..5000 from Ivan Neretin)
Programs
-
Mathematica
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 *)
-
Python
from sympy import divisors from itertools import islice def agen(): # generator of terms mina, an, aset, mink, kset = 1, 1, {1}, 1, set() while True: yield an k1, ak1, k2 = 0, mina, mink if mina < an: for d in divisors(an): if d not in aset and an//d not in kset: k1 = an//d break while k2 in kset or an*k2 in aset: k2 += 1 an, k = (an//k1, k1) if k1 > 0 else (an*k2, k2) aset.add(an) kset.add(k) while mina in aset: mina += 1 while mink in kset: mink += 1 print(list(islice(agen(), 58))) # Michael S. Branicky, Mar 18 2024
Extensions
Corrected and extended by David Wasserman, Dec 15 2004
Comments