OFFSET
1,2
COMMENTS
The canonical bijection from the positive integers to the positive rational numbers is given by A038568(n)/A038569(n).
Appears to be a variant of A049691. - R. J. Mathar, Feb 11 2012
It appears that a(n) = 2*A005728(n) - 1. - Chris Boyd, Mar 21 2015
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
The canonical bijection starts with 1/1, 1/2, 2/1, 1/3, 3/1, 2/3, 3/2, 1/4, 4/1, 3/4, 4/3, 1/5, 5/1, so that this sequence starts with 1,3,5,9,13 and A206350 starts with 1,2,4,8,12.
MATHEMATICA
a[n_] := Module[{s = 1, k = 2, j = 1},
While[s <= n, s = s + 2*EulerPhi[k]; k = k + 1];
s = s - 2*EulerPhi[k - 1];
While[s <= n, If[GCD[j, k - 1] =
= 1, s = s + 2]; j = j + 1];
If[s > n + 1, j - 1, k - 1]];
t = Table[a[n], {n, 0, 3000}]; (* A038568 *)
ReplacePart[1 + Flatten[Position[t, 1]], 1, 1]
(* A206297 *)
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def A206297(n):
if n == 1:
return 1
c, j = 1, 2
k1 = (n-1)//j
while k1 > 1:
j2 = (n-1)//k1 + 1
c += (j2-j)*(A206297(k1+1)-2)
j, k1 = j2, (n-1)//j2
return (n-2)*(n-1)-c+j+2 # Chai Wah Wu, Aug 04 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Feb 06 2012
STATUS
approved