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.

A337308 Natural numbers that yield a coprime pair representing a proper fraction under the inverse of Cantor's pairing function.

This page as a plain text file.
%I A337308 #31 Mar 26 2023 06:47:40
%S A337308 8,13,18,19,26,32,33,34,41,43,50,52,53,62,64,72,73,74,75,76,85,89,98,
%T A337308 99,100,101,102,103,114,116,118,128,131,133,134,145,147,149,151,162,
%U A337308 163,164,165,166,167,168,169,182,184,188,200,201,202,203,204,205,206
%N A337308 Natural numbers that yield a coprime pair representing a proper fraction under the inverse of Cantor's pairing function.
%C A337308 Equivalently: The image of the function f(x,y)=(x+y)*(x+y+1)/2+y for x,y coprime and 0 < x < y.
%H A337308 Wikipedia, <a href="http://en.wikipedia.org/wiki/Pairing_function#Cantor_pairing_function">Cantor's pairing function</a>.
%e A337308 The fully reduced proper fraction 2/5 is mapped to 33 by Cantor's pairing function.
%o A337308 (Python) # Edited by _M. F. Hasler_, Mar 25 2023
%o A337308 from math import gcd
%o A337308 def A337308_first(N):
%o A337308     L, b = [], 0
%o A337308     f = lambda a: (a + b) * (a + b + 1) // 2 + b
%o A337308     while N > 0:
%o A337308         b += 1
%o A337308         if len(L) > 1:
%o A337308             L.sort()
%o A337308             while L and L[0] < f(1):
%o A337308                 yield L.pop(0)
%o A337308                 N -= 1
%o A337308         L.extend(f(a) for a in range(1, b) if gcd(a, b) == 1)
%o A337308 print(list(A337308_first(50)))
%Y A337308 Superset of A277557.
%K A337308 nonn
%O A337308 1,1
%A A337308 _Alexander Fraebel_, Aug 22 2020