(MAGMAMagma) [&+[Modexp(k, 2, n) + Modexp(n, 2, k): k in [1..n]]: n in [1..50]]; // G. C. Greubel, Dec 13 2019
(MAGMAMagma) [&+[Modexp(k, 2, n) + Modexp(n, 2, k): k in [1..n]]: n in [1..50]]; // G. C. Greubel, Dec 13 2019
proposed
approved
editing
proposed
G. C. Greubel, <a href="/A049768/b049768.txt">Table of n, a(n) for n = 1..1000</a>
Table[Sum[PowerMod[k, 2, n] + PowerMod[n, 2, k], {k, n}], {n, 50}] (* G. C. Greubel, Dec 13 2019 *)
(PARI) T(n, k) = lift(Mod(k, n)^2) + lift(Mod(n, k)^2);
vector(50, n, sum(k=1, n, T(n, k)) ) \\ G. C. Greubel, Dec 13 2019
(MAGMA) [&+[Modexp(k, 2, n) + Modexp(n, 2, k): k in [1..n]]: n in [1..50]]; // G. C. Greubel, Dec 13 2019
(Sage) [sum(power_mod(k, 2, n) + power_mod(n, 2, 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-> PowerMod(k, 2, n) + PowerMod(n, 2, k)) ); # G. C. Greubel, Dec 13 2019
approved
editing
proposed
approved
editing
proposed
Cf. Row sums of A049767.
proposed
editing
editing
proposed
Cf. A049767.
seq(add((k^2 mod n) + (n^2 mod k), k = 1 .. n), n = 1 .. 50); # Petros Hadjicostas, Nov 20 2019