[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A337308
Natural numbers that yield a coprime pair representing a proper fraction under the inverse of Cantor's pairing function.
0
8, 13, 18, 19, 26, 32, 33, 34, 41, 43, 50, 52, 53, 62, 64, 72, 73, 74, 75, 76, 85, 89, 98, 99, 100, 101, 102, 103, 114, 116, 118, 128, 131, 133, 134, 145, 147, 149, 151, 162, 163, 164, 165, 166, 167, 168, 169, 182, 184, 188, 200, 201, 202, 203, 204, 205, 206
OFFSET
1,1
COMMENTS
Equivalently: The image of the function f(x,y)=(x+y)*(x+y+1)/2+y for x,y coprime and 0 < x < y.
EXAMPLE
The fully reduced proper fraction 2/5 is mapped to 33 by Cantor's pairing function.
PROG
(Python) # Edited by M. F. Hasler, Mar 25 2023
from math import gcd
def A337308_first(N):
L, b = [], 0
f = lambda a: (a + b) * (a + b + 1) // 2 + b
while N > 0:
b += 1
if len(L) > 1:
L.sort()
while L and L[0] < f(1):
yield L.pop(0)
N -= 1
L.extend(f(a) for a in range(1, b) if gcd(a, b) == 1)
print(list(A337308_first(50)))
CROSSREFS
Superset of A277557.
Sequence in context: A006613 A204221 A348277 * A014134 A085989 A319879
KEYWORD
nonn
AUTHOR
Alexander Fraebel, Aug 22 2020
STATUS
approved