OFFSET
1,2
COMMENTS
a(n) is the sum of the terms in the n-th antidiagonal of the A126572 array. - Michel Marcus, Mar 14 2018
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
EXAMPLE
The integers coprime to 1 are 1,2,3,4,5,6,... The 5th of these is 5. The integers coprime to 2 are 1,3,5,7,9,... The 4th of these is 7. The integers coprime to 3 are 1,2,4,5,7,... The 3rd of these is 4. The integers coprime to 4 are 1,3,5,... The 2nd of these is 3. And the integers coprime to 5 are 1,2,3,4,6,... The first of these is 1. So a(5) = 5 + 7 + 4 + 3 + 1 = 20.
MATHEMATICA
a = {}; For[n = 1, n < 50, n++, s = 0; For[k = 1, k < n + 1, k++, c = 0; i = 1; While[c < k, If[GCD[i, n + 1 - k] == 1, c++ ]; i++ ]; s = s + i - 1]; AppendTo[a, s]]; a (* Stefan Steinerberger, Nov 01 2007 *)
PROG
(Haskell)
a132273 n = sum $ zipWith (!!) coprimess (reverse [0..n-1]) where
coprimess = map (\x -> filter ((== 1) . (gcd x)) [1..]) [1..]
-- Reinhard Zumkeller, Jul 08 2012
(PARI) cop(k, j) = {my(nbc = 0, i = 0); while (nbc != j, i++; if (gcd(i, k)==1, nbc++)); i; }
a(n) = vecsum(vector(n, k, cop(k, n-k+1))); \\ Michel Marcus, Mar 14 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Aug 16 2007
EXTENSIONS
More terms from Stefan Steinerberger, Nov 01 2007
STATUS
approved