OFFSET
2,2
COMMENTS
The smallest prime factor of n^n-1 of the form k*n+1 is A187023(n).
LINKS
Amiram Eldar, Table of n, a(n) for n = 2..138
EXAMPLE
7^7-1 = 2*3*29*4733; the smallest prime divisor of the form k*n+1 is 29 = 4*7+1, hence a(7) = 4.
MATHEMATICA
Table[p=First/@FactorInteger[n^n-1]; (Select[p, Mod[#1, n] == 1 &, 1][[1]] - 1)/n, {n, 2, 40}]
PROG
(Magma) A187025:=function(n); for d in PrimeDivisors(n^n-1) do if d mod n eq 1 then return (d-1)/n; end if; end for; return 0; end function; [ A187025(n): n in [2..50] ]; // Klaus Brockhaus, Mar 02 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Mar 02 2011
STATUS
approved