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!)
A366917 a(n) = Sum_{k=1..n} (-1)^k*k^3*floor(n/k). 3
-1, 6, -22, 49, -77, 119, -225, 358, -399, 483, -849, 1139, -1059, 1349, -2179, 2500, -2414, 2885, -3975, 4971, -4661, 4663, -7505, 8819, -6932, 8454, -11986, 12438, -11952, 12744, -17048, 20399, -16897, 17501, -25843, 27904, -22750, 25270, -36274, 37184, -31738 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = 16*A064603(floor(n/2)) - A064603(n).
MAPLE
f:= proc(n) local k; add((-1)^k * k^3 * floor(n/k), k=1..n) end proc;
map(f, [$1..100]); # Robert Israel, Dec 29 2023
MATHEMATICA
a[n_]:=Sum[ (-1)^k*k^3*Floor[n/k], {k, n}]; Array[a, 41] (* Stefano Spezia, Oct 29 2023 *)
PROG
(Python)
from math import isqrt
def A366917(n): return (-(t:=isqrt(m:=n>>1))**3*(t+1)**2+sum((q:=m//k)*((k**3<<2)+q*(q*(q+2)+1)) for k in range(1, t+1))<<2)+((s:=isqrt(n))**3*(s+1)**2 - sum((q:=n//k)*((k**3<<2)+q*(q*(q+2)+1)) for k in range(1, s+1))>>2)
(PARI) a(n) = sum(k=1, n, (-1)^k*k^3*(n\k)); \\ Michel Marcus, Oct 29 2023
CROSSREFS
Sequence in context: A072972 A216050 A202803 * A092185 A216894 A212692
KEYWORD
sign,look
AUTHOR
Chai Wah Wu, Oct 28 2023
STATUS
approved

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 August 13 20:02 EDT 2024. Contains 375144 sequences. (Running on oeis4.)