[go: up one dir, main page]

login
A360600
Inverse permutation to A360599.
2
1, 2, 3, 5, 6, 4, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24, 26, 7, 27, 29, 30, 32, 33, 35, 36, 38, 39, 41, 42, 44, 45, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 65, 66, 68, 69, 71, 72, 74, 75, 77, 78, 10, 80, 81, 83, 84, 86, 87, 89, 90, 92, 93, 95
OFFSET
1,2
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
Cf. A360599.
Sequence in context: A335858 A137760 A368428 * A194863 A194833 A195108
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 13 2023
STATUS
approved