OFFSET
1,1
FORMULA
EXAMPLE
For n = 1 the first level of the stepped pyramid is a cube, so a(1) = 6.
MATHEMATICA
s=0; Do[s=s+4*DivisorSigma[1, n]; t=2n(n+1); Print[(s/2)+t], {n, 1, 8000}] (* Metin Sariyar, Nov 20 2019 *)
PROG
(Python)
from math import isqrt
def A328366(n): return (n*(n+1)<<1)-(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1, s+1)) # Chai Wah Wu, Oct 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Oct 26 2019
STATUS
approved