This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A366917 #17 Dec 29 2023 05:53:10 %S A366917 -1,6,-22,49,-77,119,-225,358,-399,483,-849,1139,-1059,1349,-2179, %T A366917 2500,-2414,2885,-3975,4971,-4661,4663,-7505,8819,-6932,8454,-11986, %U A366917 12438,-11952,12744,-17048,20399,-16897,17501,-25843,27904,-22750,25270,-36274,37184,-31738 %N A366917 a(n) = Sum_{k=1..n} (-1)^k*k^3*floor(n/k). %H A366917 Robert Israel, <a href="/A366917/b366917.txt">Table of n, a(n) for n = 1..10000</a> %F A366917 a(n) = 16*A064603(floor(n/2)) - A064603(n). %p A366917 f:= proc(n) local k; add((-1)^k * k^3 * floor(n/k), k=1..n) end proc; %p A366917 map(f, [$1..100]); # _Robert Israel_, Dec 29 2023 %t A366917 a[n_]:=Sum[ (-1)^k*k^3*Floor[n/k],{k,n}]; Array[a,41] (* _Stefano Spezia_, Oct 29 2023 *) %o A366917 (Python) %o A366917 from math import isqrt %o A366917 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) %o A366917 (PARI) a(n) = sum(k=1, n, (-1)^k*k^3*(n\k)); \\ _Michel Marcus_, Oct 29 2023 %Y A366917 Cf. A024919, A366915, A064603. %K A366917 sign,look %O A366917 1,2 %A A366917 _Chai Wah Wu_, Oct 28 2023