This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A020653 Denominators in canonical bijection from positive integers to positive rationals. 19
 1, 2, 1, 3, 1, 4, 3, 2, 1, 5, 1, 6, 5, 4, 3, 2, 1, 7, 5, 3, 1, 8, 7, 5, 4, 2, 1, 9, 7, 3, 1, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 11, 7, 5, 1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 13, 11, 9, 5, 3, 1, 14, 13, 11, 8, 7, 4, 2, 1, 15, 13, 11, 9, 7, 5, 3, 1, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 17 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 REFERENCES Richard Courant and Herbert Robbins. What Is Mathematics?, Oxford, 1941, pp. 79-80. H. Lauwerier, Fractals, Princeton Univ. Press, p. 23. LINKS David Wasserman, Table of n, a(n) for n = 1..100000 MAPLE with (numtheory): A020653 := proc (n) local sum, j, k; sum := 0: k := 2: while (sum < n) do: sum := sum + phi(k): k := k + 1: od: sum := sum - phi(k-1): j := 1; while sum < n do: if gcd(j, k-1) = 1 then sum := sum + 1: fi: j := j+1: od: RETURN (k-j): end: # Ulrich Schimke (ulrschimke(AT)aol.com), Nov 06 2001 MATHEMATICA a[n_] := Module[{s=0, k=2}, While [s < n, s = s + EulerPhi[k]; k = k+1]; s = s - EulerPhi[k-1]; j=1; While[s < n , If[GCD[j, k-1] == 1 , s = s+1]; j = j+1]; k-j]; Table[a[n], {n, 1, 96}] (* Jean-François Alcover, Dec 06 2012, after Ulrich Schimke's Maple program *) Flatten[Map[Denominator[#/Reverse[#]]&, Table[Flatten[Position[GCD[Map[Mod[#, n]&, Range[n-1]], n], 1]], {n, 100}]]] (* Peter J. C. Moses, Apr 17 2013 *) PROG (Haskell) a020653 n = a020653_list !! (n-1) a020653_list = concat \$ map reverse \$ tail a038566_tabf -- Reinhard Zumkeller, Oct 30 2012 (Python) from sympy import totient, gcd def a(n):     s=0     k=2     while s

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