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!)
A308313 a(n) = Sum_{k=1..n} (-1)^(n-k) * k^n * floor(n/k). 3
1, 2, 22, 203, 2285, 33855, 609345, 12420372, 284964519, 7347342215, 209807114169, 6554034238459, 222469737401739, 8159109186320903, 321461264348047819, 13538455640979049698, 606976994365011212414, 28864017965496692865925, 1451086990386146504580735, 76896033641977171208887465 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = [x^n] (1/(1 + x)) * Sum_{k>=1} k^n * x^k/(1 - (-x)^k).
a(n) = Sum_{k=1..n} Sum_{d|k} (-1)^(n-d) * d^n.
a(n) ~ c * n^n, where c = 1/(1 + exp(-1)) = 0.7310585786300048792511592418218362743651446401650565192763659... - Vaclav Kotesovec, Aug 22 2019, updated Jul 19 2021
Let A(n,k) = Sum_{j=1..n} j^k * floor(n/j). Then a(n) = (-1)^n*(2^(n+1)*A(floor(n/2),n)-A(n,n)). - Chai Wah Wu, Oct 28 2023
MATHEMATICA
Table[Sum[(-1)^(n - k) k^n Floor[n/k] , {k, 1, n}], {n, 1, 20}]
Table[SeriesCoefficient[1/(1 + x) Sum[k^n x^k/(1 - (-x)^k), {k, 1, n}], {x, 0, n}], {n, 1, 20}]
Table[(-1)^n Sum[DivisorSigma[n, k] - 2 Total[Select[Divisors[k], OddQ]^n], {k, 1, n}], {n, 1, 20}]
PROG
(PARI) a(n)={sum(k=1, n, (-1)^(n-k) * k^n * (n\k))} \\ Andrew Howroyd, Aug 22 2019
(Python)
from math import isqrt
from sympy import bernoulli
def A308313(n): return (-1 if n&1 else 1)*((((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)
CROSSREFS
Sequence in context: A255043 A359856 A366919 * A304024 A239688 A350965
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Aug 22 2019
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 April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)