OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
MAPLE
seq( add( `mod`(k, n) + `mod`(n, k), k = 1..n), n = 1..50); # G. C. Greubel, Dec 13 2019
MATHEMATICA
T[n_, k_] := Mod[n, k] + Mod[k, n]; Map[Total[T[#, Range[#]]] &, Range[80]] (* Carl Najafi, Aug 24 2011 *)
PROG
(PARI) a(n) = sum(k=1, n, k%n + n%k); \\ Michel Marcus, Aug 22 2015
(Magma) [&+[ (k mod n) + (n mod k): k in [1..n]]: n in [1..50]]; // G. C. Greubel, Dec 13 2019
(Sage) [sum((k%n) + (n%k) for k in (1..n)) for n in (1..50)] # G. C. Greubel, Dec 13 2019
(GAP) List([1..50], n-> Sum([1..n], k-> (k mod n) + (n mod k)) ); # G. C. Greubel, Dec 13 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved