OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..600
EXAMPLE
For n=5, 5*(19^5-1)+1 = 12380491 is prime, but 5*(p^5-1)+1 is not prime for primes p < 19, so a(5)=19.
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]);
MATHEMATICA
Table[p=2; While[!PrimeQ[n (p^n-1)+1], p=NextPrime@p]; p, {n, 100}] (* Vincenzo Librandi, Oct 11 2017 *)
PROG
(PARI) a(n)=forprime(p=2, , if(ispseudoprime(n*(p^n-1)+1), return(p))) \\ Charles R Greathouse IV, Mar 07 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Mar 07 2017
STATUS
approved