OFFSET
2,3
COMMENTS
If n is an odd prime, a(n) = 0.
If n is prime, a(n^2) = n.
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
MAPLE
seq((n*(n+1)/2) mod add(t[1]*t[2], t=ifactors(n)[2]), n=2..100);
MATHEMATICA
a[n_] := Mod[n*(n + 1)/2, Plus @@ Times @@@ FactorInteger[n]]; Array[a, 100, 2] (* Amiram Eldar, Apr 15 2022 *)
PROG
(Python)
from sympy import factorint
def a(n): return (n*(n+1)//2)%sum(p*e for p, e in factorint(n).items())
print([a(n) for n in range(2, 98)]) # Michael S. Branicky, Apr 24 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Apr 14 2022
STATUS
approved