OFFSET
1,1
COMMENTS
Note that f_n(p) = n*(p^n-1)-1 = n*p^n-(n+1) is irreducible over the rationals as a polynomial in p: if n <> 8 Eisenstein's criterion applies to either f_n(p) or its reversal -(n+1)*p^n+n, using Mihailescu's theorem. Thus the generalized Bunyakovsky conjecture implies a(n) always exists. - Robert Israel, Oct 24 2017
LINKS
Iain Fox, Table of n, a(n) for n = 1..1000
EXAMPLE
For n=5, 5*(5^5-1)-1 = 15619 is prime, but 5*(p^5-1)-1 is not prime for primes p < 5, so a(5)=5.
MAPLE
f:= proc(n) local p;
p:= 2;
while not isprime(n*(p^n-1)-1) do p:= nextprime(p) od:
p
end proc:
map(f, [$1..100]); # Robert Israel, Oct 24 2017
MATHEMATICA
Table[p=2; While[!PrimeQ[n (p^n - 1) - 1], p=NextPrime@p]; p, {n, 100}]
PROG
(PARI) a(n) = forprime(p=2, , if(ispseudoprime(n*(p^n-1)-1), return(p))) \\ Iain Fox, Oct 23 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Vincenzo Librandi, Oct 12 2017
STATUS
approved