login
A256532
Product of n and the sum of remainders of n mod k, for k = 1, 2, 3, ..., n.
3
0, 0, 3, 4, 20, 18, 56, 64, 108, 130, 242, 204, 364, 434, 540, 576, 867, 846, 1216, 1220, 1470, 1694, 2254, 2040, 2575, 2912, 3375, 3472, 4379, 4140, 5177, 5344, 6072, 6698, 7630, 7128, 8621, 9424, 10491, 10320, 12177, 11928, 13975, 14432, 15255, 16468, 18941, 17952, 20286, 21000, 22899, 23608, 26765, 26568, 29095
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).
Note that the union of this right prism and the irregular staircase after n-th stage described in A244580 and the irregular stepped pyramid after (n-1)-th stage described in A245092, form a hexahedron (or cube) of side length n. This comment is represented by the third formula.
LINKS
FORMULA
a(n) = n * A004125(n).
a(n) = n^3 - A256533(n).
a(n) = n^3 - A143128(n) - A175254(n-1), n > 1.
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
KEYWORD
nonn
AUTHOR
Omar E. Pol, May 03 2015
STATUS
approved