OFFSET
1,2
LINKS
EXAMPLE
A360599(59) = 42, so a(42) = 59.
PROG
(PARI) See Links section.
(Python)
from itertools import islice
def agen(): # generator of terms
an, ratios, inv, n = 1, set(), dict(), 1
while True:
k = 1
q, r = divmod(max(k, an), min(k, an))
while r != 0 or q in ratios:
k += 1
q, r = divmod(max(k, an), min(k, an))
an = k
ratios.add(q)
inv[q] = len(ratios)
while n in inv:
yield inv[n]
n += 1
print(list(islice(agen(), 67))) # Michael S. Branicky, Feb 13 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 13 2023
STATUS
approved