OFFSET
1,3
COMMENTS
a(n) is also the volume (or the total number of unit cubes) of a polycube which is a right prism whose base is the symmetric representation of A004125(n).
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(5) = 20 because 5 * (0 + 1 + 2 + 1) = 5 * 4 = 20.
a(6) = 18 because 6 * (0 + 0 + 0 + 2 + 1) = 6 * 3 = 18.
a(7) = 56 because 7 * (0 + 1 + 1 + 3 + 2 + 1) = 7 * 8 = 56.
MATHEMATICA
Table[n*Sum[Mod[n, i], {i, 2, n-1}], {n, 55}] (* Ivan N. Ianakiev, May 04 2015 *)
PROG
(PARI) vector(50, n, n*sum(k=1, n, n % k)) \\ Michel Marcus, May 05 2015
(Python)
def A256532(n):
....s=0
....for k in range(1, n+1):
........s+=n%k
....return s*n # Indranil Ghosh, Feb 13 2017
(Python)
from math import isqrt
def A256532(n): return n**3+n*((s:=isqrt(n))**2*(s+1)-sum((q:=n//k)*((k<<1)+q+1) for k in range(1, s+1))>>1) # Chai Wah Wu, Oct 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, May 03 2015
STATUS
approved