login
A356243
a(n) = Sum_{k=1..n} k^2 * sigma_{n-2}(k).
3
1, 9, 49, 447, 4607, 71009, 1210855, 24980627, 575624572, 14958422046, 427890493960, 13431874937840, 457651929853662, 16844143705998554, 665499756005678382, 28102799297908820326, 1262909308355648335240, 60183118566605371095996
OFFSET
1,2
FORMULA
a(n) = Sum_{k=1..n} k^n * Sum_{j=1..floor(n/k)} j^2 = Sum_{k=1..n} k^n * A000330(floor(n/k)).
a(n) = [x^n] (1/(1-x)) * Sum_{k>=1} k^n * x^k * (1 + x^k)/(1 - x^k)^3.
MATHEMATICA
a[n_] := Sum[k^2 * DivisorSigma[n - 2, k], {k, 1, n}]; Array[a, 18] (* Amiram Eldar, Jul 30 2022 *)
PROG
(PARI) a(n) = sum(k=1, n, k^2*sigma(k, n-2));
(PARI) a(n) = sum(k=1, n, k^n*sum(j=1, n\k, j^2));
(Python)
from math import isqrt
from sympy import bernoulli
def A356243(n): return (((s:=isqrt(n))*(s+1)*(2*s+1))*((b:=bernoulli(n+1))-bernoulli(n+1, s+1)) + sum(k**n*(n+1)*((q:=n//k)*(q+1)*(2*q+1))+6*k**2*(bernoulli(n+1, q+1)-b) for k in range(1, s+1)))//(n+1)//6 # Chai Wah Wu, Oct 21 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Jul 30 2022
STATUS
approved