|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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)
....s=0
....for k in range(1, n+1):
........s+=n%k
(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
|
Cf. A000203, A000578, A004125, A024916, A143128, A175254, A236104, A236112, A237270, A237271, A237593, A244580, A245092, A256533.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|