OFFSET
2,3
COMMENTS
a(n) = 1 if and only if n is a prime or n is a Carmichael number.
a(n) is divisible by 4 if n is divisible by 4, otherwise a(n) is odd. - Robert Israel, Oct 08 2015
a(n) = n iff 4|n or n = 35, 55, 77, 95; A121707 ?
a(5005) = 11: this is the first case where a(n) is prime and A001222(n) > 3. - Altug Alkan, Oct 08 2015
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
FORMULA
a(4n) = 4n.
a(n) = gcd(A031971(n-1), n). - Michel Marcus, Oct 08 2015
MAPLE
f:= n -> igcd(n, add(j &^(n-1) mod n, j=1..n-1)):
seq(f(n), n=2..1000); # Robert Israel, Oct 08 2015
MATHEMATICA
Table[GCD[n, Total@ Map[#^(n - 1) &, Range[n - 1]]], {n, 2, 96}] (* Michael De Vlieger, Oct 08 2015 *)
PROG
(PARI) vector(100, n, gcd(n+1, sum(k=1, n, k^n))) \\ Altug Alkan, Oct 08 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Oct 07 2015
STATUS
approved