A352996 a(n) = n*(n+1)/2 mod (sum (with multiplicity) of prime factors of n).
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
Keywords
Examples
For n = 6, A000217(6) = 6*7/2 = 21 and A001414(6) = 2+3 = 5, so a(6) = 21 mod 5 = 1.
Links
- Robert Israel, Table of n, a(n) for n = 2..10000
Programs
-
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 *)
-
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
Comments