login
A049766
a(n) = Sum_{k=1..n} T(n,k), array T as in A049765.
3
0, 1, 4, 7, 14, 18, 29, 36, 48, 58, 77, 83, 106, 122, 141, 156, 187, 200, 235, 251, 280, 308, 351, 361, 403, 437, 476, 502, 557, 573, 632, 663, 712, 758, 813, 828, 899, 951, 1010, 1038, 1117, 1145, 1228, 1274, 1329, 1393, 1484
OFFSET
1,3
LINKS
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
Row sums of A049765.
Sequence in context: A310917 A310918 A310919 * A244905 A310920 A161426
KEYWORD
nonn
STATUS
approved