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!)
 A137324 a(n) = Sum_{prime p < n} gcd(n,p). 1

%I

%S 1,3,2,6,3,5,6,9,4,8,5,13,12,7,6,10,7,13,16,19,8,12,13,22,11,16,9,17,

%T 10,12,23,28,21,14,11,31,26,17,12,22,13,25,20,37,14,18,21,20,33,28,15,

%U 19,30,23,36,45,16,24,17,49,26,19,34,31,18,36,43,30,19,23,20,58,27,40,37

%N a(n) = Sum_{prime p < n} gcd(n,p).

%F a(p) = A000720(p) - 1 for prime p. - _R. J. Mathar_, Apr 09 2008

%e a(10) = 9 because gcd(10,2) = 2, gcd(10,3) = 1, gcd(10,5) = 5, gcd(10,7) = 1; 2 + 1 + 5 + 1 = 9.

%e The underlying irregular table of gcd(n,2), gcd(n,3), gcd(n,5), gcd(n,7), etc., for which a(n) provides row sums, is obtained by deleting columns from A050873(n,k) and looks as follows for n=3,4,5,...:

%e 1

%e 2 1

%e 1 1

%e 2 3 1

%e 1 1 1

%e 2 1 1 1

%e 1 3 1 1

%e 2 1 5 1

%e 1 1 1 1

%e 2 3 1 1 1

%e 1 1 1 1 1

%e 2 1 1 7 1 1

%e 1 3 5 1 1 1

%e 2 1 1 1 1 1

%e 1 1 1 1 1 1

%e 2 3 1 1 1 1 1

%e 1 1 1 1 1 1 1

%e 2 1 5 1 1 1 1 1

%p A137324 := proc(n) local a,i; a :=0 ; for i from 1 to numtheory[pi](n-1) do a := a+gcd(n,ithprime(i)) ; od: a; end: seq(A137324(n),n=3..80) ; # _R. J. Mathar_, Apr 09 2008

%t Table[Plus @@ GCD[n, Select[Range[n - 1], PrimeQ[ # ] &]], {n, 3, 70}] (* _Stefan Steinerberger_, Apr 09 2008 *)

%o (PARI) a(n) = sum(k=1, n-1, gcd(n,k)*isprime(k)); \\ _Michel Marcus_, Nov 07 2014

%o (MAGMA) [&+[Gcd(n,p):p in PrimesInInterval(1,n-1)]:n in [3..77]]; // _Marius A. Burtea_, Aug 07 2019

%Y Cf. A006579.

%K easy,nonn

%O 3,2

%A _Max Sills_, Apr 06 2008

%E Corrected and extended by _R. J. Mathar_ and _Stefan Steinerberger_, Apr 09 2008

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 April 20 19:13 EDT 2021. Contains 343137 sequences. (Running on oeis4.)