Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #38 Oct 23 2023 01:59:57
%S 0,0,3,4,20,18,56,64,108,130,242,204,364,434,540,576,867,846,1216,
%T 1220,1470,1694,2254,2040,2575,2912,3375,3472,4379,4140,5177,5344,
%U 6072,6698,7630,7128,8621,9424,10491,10320,12177,11928,13975,14432,15255,16468,18941,17952,20286,21000,22899,23608,26765,26568,29095
%N Product of n and the sum of remainders of n mod k, for k = 1, 2, 3, ..., n.
%C 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).
%C 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.
%H Indranil Ghosh, <a href="/A256532/b256532.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = n * A004125(n).
%F a(n) = n^3 - A256533(n).
%F a(n) = n^3 - A143128(n) - A175254(n-1), n > 1.
%e a(5) = 20 because 5 * (0 + 1 + 2 + 1) = 5 * 4 = 20.
%e a(6) = 18 because 6 * (0 + 0 + 0 + 2 + 1) = 6 * 3 = 18.
%e a(7) = 56 because 7 * (0 + 1 + 1 + 3 + 2 + 1) = 7 * 8 = 56.
%t Table[n*Sum[Mod[n,i],{i,2,n-1}],{n,55}] (* _Ivan N. Ianakiev_, May 04 2015 *)
%o (PARI) vector(50, n, n*sum(k=1, n, n % k)) \\ _Michel Marcus_, May 05 2015
%o (Python)
%o def A256532(n):
%o ....s=0
%o ....for k in range(1,n+1):
%o ........s+=n%k
%o ....return s*n # _Indranil Ghosh_, Feb 13 2017
%o (Python)
%o from math import isqrt
%o 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
%Y Cf. A000203, A000578, A004125, A024916, A143128, A175254, A236104, A236112, A237270, A237271, A237593, A244580, A245092, A256533.
%K nonn
%O 1,3
%A _Omar E. Pol_, May 03 2015