login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A132273 a(n) = Sum{k=1..n} (k-th integer from among those positive integers that are coprime to (n+1-k)). 5

%I #19 Mar 14 2018 04:25:52

%S 1,3,7,12,20,28,41,52,69,83,103,122,149,169,197,222,257,285,322,355,

%T 397,431,477,514,567,610,662,708,769,815,882,935,1000,1056,1123,1182,

%U 1267,1326,1404,1471,1554,1628,1712,1790,1882,1958,2057,2137,2240

%N a(n) = Sum{k=1..n} (k-th integer from among those positive integers that are coprime to (n+1-k)).

%C a(n) is the sum of the terms in the n-th antidiagonal of the A126572 array. - _Michel Marcus_, Mar 14 2018

%H Reinhard Zumkeller, <a href="/A132273/b132273.txt">Table of n, a(n) for n = 1..1000</a>

%e 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.

%t 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 *)

%o (Haskell)

%o a132273 n = sum $ zipWith (!!) coprimess (reverse [0..n-1]) where

%o coprimess = map (\x -> filter ((== 1) . (gcd x)) [1..]) [1..]

%o -- _Reinhard Zumkeller_, Jul 08 2012

%o (PARI) cop(k, j) = {my(nbc = 0, i = 0); while (nbc != j, i++; if (gcd(i,k)==1, nbc++)); i;}

%o a(n) = vecsum(vector(n, k, cop(k, n-k+1))); \\ _Michel Marcus_, Mar 14 2018

%Y Cf. A126572, A132274, A132275.

%K nonn

%O 1,2

%A _Leroy Quet_, Aug 16 2007

%E More terms from _Stefan Steinerberger_, Nov 01 2007

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 06:15 EDT 2024. Contains 371265 sequences. (Running on oeis4.)