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!)
A366919 a(n) = Sum_{k=1..n} (-1)^k*k^n*floor(n/k). 2
-1, 2, -22, 203, -2285, 33855, -609345, 12420372, -284964519, 7347342215, -209807114169, 6554034238459, -222469737401739, 8159109186320903, -321461264348047819, 13538455640979049698, -606976994365011212414, 28864017965496692865925, -1451086990386146504580735 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = (-1)^n*A308313(n).
Let A(n,k) = Sum_{j=1..n} j^k * floor(n/j). Then a(n) = 2^(n+1)*A(floor(n/2),n)-A(n,n).
MATHEMATICA
a[n_]:=Sum[ (-1)^k*k^n*Floor[n/k], {k, n}]; Array[a, 19] (* Stefano Spezia, Oct 29 2023 *)
PROG
(Python)
from math import isqrt
from sympy import bernoulli
def A366919(n): return ((((s:=isqrt(m:=n>>1))+1)*(bernoulli(n+1)-bernoulli(n+1, s+1))<<n+1)-((t:=isqrt(n))+1)*(bernoulli(n+1)-bernoulli(n+1, t+1))+(sum(w**n*(n+1)*((q:=m//w)+1)-bernoulli(n+1)+bernoulli(n+1, q+1) for w in range(1, s+1))<<n+1)-sum(w**n*(n+1)*((q:=n//w)+1)-bernoulli(n+1)+bernoulli(n+1, q+1) for w in range(1, t+1)))//(n+1)
(PARI) a(n) = sum(k=1, n, (-1)^k*k^n*(n\k)); \\ Michel Marcus, Oct 29 2023
CROSSREFS
Sequence in context: A058441 A255043 A359856 * A308313 A304024 A239688
KEYWORD
sign
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 July 17 05:50 EDT 2024. Contains 374360 sequences. (Running on oeis4.)