OFFSET
1,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = A066911(n) modulo n. - Michel Marcus, May 20 2014
a(prime(n)) = A071089(n). - Michel Marcus, May 20 2014
EXAMPLE
a(8) = (3 + 5 + 7) (mod 8) = 7 because 3, 5 and 7 are the primes < 8 that do not divide 8.
MATHEMATICA
Table[Mod[Total[Select[Prime[Range[PrimePi[n]]], Mod[n, #]!=0&]], n], {n, 80}] (* Harvey P. Dale, Aug 06 2019 *)
PROG
(PARI) a(n) = sum(i=1, n-1, if (isprime(i) && (n%i), i)) % n; \\ Michel Marcus, May 20 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 22 2002
STATUS
approved