cp's OEIS Frontend

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.

A308313 a(n) = Sum_{k=1..n} (-1)^(n-k) * k^n * floor(n/k).

This page as a plain text file.
%I A308313 #23 Oct 28 2023 23:53:18
%S A308313 1,2,22,203,2285,33855,609345,12420372,284964519,7347342215,
%T A308313 209807114169,6554034238459,222469737401739,8159109186320903,
%U A308313 321461264348047819,13538455640979049698,606976994365011212414,28864017965496692865925,1451086990386146504580735,76896033641977171208887465
%N A308313 a(n) = Sum_{k=1..n} (-1)^(n-k) * k^n * floor(n/k).
%F A308313 a(n) = [x^n] (1/(1 + x)) * Sum_{k>=1} k^n * x^k/(1 - (-x)^k).
%F A308313 a(n) = Sum_{k=1..n} Sum_{d|k} (-1)^(n-d) * d^n.
%F A308313 a(n) ~ c * n^n, where c = 1/(1 + exp(-1)) = 0.7310585786300048792511592418218362743651446401650565192763659... - _Vaclav Kotesovec_, Aug 22 2019, updated Jul 19 2021
%F A308313 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
%t A308313 Table[Sum[(-1)^(n - k) k^n Floor[n/k] , {k, 1, n}], {n, 1, 20}]
%t A308313 Table[SeriesCoefficient[1/(1 + x) Sum[k^n x^k/(1 - (-x)^k), {k, 1, n}], {x, 0, n}], {n, 1, 20}]
%t A308313 Table[(-1)^n Sum[DivisorSigma[n, k] - 2 Total[Select[Divisors[k], OddQ]^n], {k, 1, n}], {n, 1, 20}]
%o A308313 (PARI) a(n)={sum(k=1, n, (-1)^(n-k) * k^n * (n\k))} \\ _Andrew Howroyd_, Aug 22 2019
%o A308313 (Python)
%o A308313 from math import isqrt
%o A308313 from sympy import bernoulli
%o A308313 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)
%Y A308313 Cf. A319194, A319649.
%K A308313 nonn
%O A308313 1,2
%A A308313 _Ilya Gutkovskiy_, Aug 22 2019