login
A352996
a(n) = n*(n+1)/2 mod (sum (with multiplicity) of prime factors of n).
4
1, 0, 2, 0, 1, 0, 0, 3, 6, 0, 1, 0, 6, 0, 0, 0, 3, 0, 3, 1, 6, 0, 3, 5, 6, 0, 10, 0, 5, 0, 8, 1, 6, 6, 6, 0, 6, 12, 6, 0, 3, 0, 0, 1, 6, 0, 10, 7, 3, 6, 1, 0, 0, 4, 10, 3, 6, 0, 6, 0, 6, 1, 4, 3, 3, 0, 15, 23, 7, 0, 0, 0, 6, 3, 5, 15, 3, 0, 3, 9, 6, 0, 0, 3, 6, 20, 6, 0, 0, 6, 12, 19, 6, 0, 2, 0
OFFSET
2,3
COMMENTS
If n is an odd prime, a(n) = 0.
If n is prime, a(n^2) = n.
LINKS
FORMULA
a(n) = A000217(n) mod A001414(n).
EXAMPLE
For n = 6, A000217(6) = 6*7/2 = 21 and A001414(6) = 2+3 = 5, so a(6) = 21 mod 5 = 1.
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