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!)
A199806 Alternating LCM-sum: a(n) = Sum_{k=1..n} (-1)^(k-1)*lcm(k,n). 2

%I #30 Jan 30 2024 17:49:09

%S 1,0,0,8,-5,18,-14,80,-9,100,-44,204,-65,294,30,672,-119,540,-152,

%T 1040,63,1210,-230,1752,-75,2028,-54,2996,-377,2190,-434,5440,165,

%U 4624,280,5472,-629,6498,234,8800,-779,6300,-860,12188,225,11638,-1034,14256,-245,13000

%N Alternating LCM-sum: a(n) = Sum_{k=1..n} (-1)^(k-1)*lcm(k,n).

%H Amiram Eldar, <a href="/A199806/b199806.txt">Table of n, a(n) for n = 1..10000</a>

%H Laszlo Toth, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL14/Toth/toth9.html">Weighted gcd-sum functions</a>, J. Integer Sequences, 14 (2011), Article 11.7.7

%t Table[Sum[(-1)^(k-1) LCM[k,n],{k,n}],{n,50}] (* _Harvey P. Dale_, Jan 30 2024 *)

%o (Sage)

%o def A199806(n) : return add((-1)^(k-1)*lcm(k,n) for k in (1..n))

%o [A199806(n) for n in (1..50)] # _Peter Luschny_, Nov 10 2011

%o (PARI) a(n)=-sum(k=1,n,(-1)^k*lcm(k,n)) \\ _Charles R Greathouse IV_, Nov 10 2011

%o (Magma) [&+[(-1)^(k-1)*Lcm(k,n):k in [1..n]]: n in [1..50]]; // _Marius A. Burtea_, Oct 02 2019

%Y Cf. A051193, A199084.

%K sign

%O 1,4

%A _Laszlo Toth_, Nov 10 2011

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 April 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)