The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A038569 Denominators in canonical bijection from positive integers to positive rationals. 10
 1, 2, 1, 3, 1, 3, 2, 4, 1, 4, 3, 5, 1, 5, 2, 5, 3, 5, 4, 6, 1, 6, 5, 7, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 8, 1, 8, 3, 8, 5, 8, 7, 9, 1, 9, 2, 9, 4, 9, 5, 9, 7, 9, 8, 10, 1, 10, 3, 10, 7, 10, 9, 11, 1, 11, 2, 11, 3, 11, 4, 11, 5, 11, 6, 11, 7, 11, 8, 11, 9, 11, 10, 12, 1, 12, 5, 12, 7, 12, 11, 13, 1, 13 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,2 REFERENCES H. Lauwerier, Fractals, Princeton Univ. Press, p. 23. LINKS David Wasserman, Table of n, a(n) for n = 0..100000 EXAMPLE First arrange fractions by increasing denominator, then by increasing numerator: 1/1, 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, ... (this is A038566/A038567); now follow each term with its reciprocal: 1/1, 1/2, 2/1, 1/3, 3/1, 2/3, 3/2, 1/4, 4/1, 3/4, 4/3, ... (this is A038568/A038569). MAPLE with (numtheory): A038569 := proc (n) local sum, j, k; sum := 1: k := 2: while (sum < n) do: sum := sum + 2 * phi(k): k := k + 1: od: sum := sum - 2 * phi(k-1): j := 1: while sum < n do: if gcd(j, k-1) = 1 then sum := sum + 2: fi: j := j+1: od: if sum > n then RETURN (k-1) fi: RETURN (j-1): end: # Ulrich Schimke (ulrschimke(AT)aol.com) 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, k-1, j-1]]; Table[a[n], {n, 0, 99}](* Jean-François Alcover, Nov 10 2011, after Maple *) PROG (Python) from sympy import totient, gcd def a(n):     s=1     k=2     while s<=n:         s+=2*totient(k)         k+=1     s-=2*totient(k - 1)     j=1     while s<=n:         if gcd(j, k - 1)==1: s+=2         j+=1     if s>n + 1: return k - 1     return j - 1 # Indranil Ghosh, May 23 2017, translated from Mathematica CROSSREFS Cf. A020652, A020653, A038566-A038569. Sequence in context: A307908 A316436 A303674 * A308686 A020650 A124224 Adjacent sequences:  A038566 A038567 A038568 * A038570 A038571 A038572 KEYWORD nonn,frac,core,nice AUTHOR EXTENSIONS More terms from Erich Friedman STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified February 16 15:55 EST 2020. Contains 331961 sequences. (Running on oeis4.)