OFFSET
2,1
LINKS
Robert Israel, Table of n, a(n) for n = 2..447
FORMULA
EXAMPLE
a(8) = 161599 = 4*8! - 1 is a prime.
MAPLE
f:= proc(n) local w, k;
w:= n!;
for k from 1 do
if isprime(k*w-1) then return k*w-1 fi
od
end proc:
map(f, [$1..30]); # Robert Israel, Nov 23 2023
MATHEMATICA
Do[k = 1; While[ !PrimeQ[k*n! - 1], k++ ]; Print[k*n! - 1], {n, 2, 20}]
PROG
(PARI) a(n)=if(n<1, 0, k=1; while(isprime(k*n!-1)==0, k++); k*n!-1)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 13 2003
EXTENSIONS
Corrected and extended by Benoit Cloitre, Jun 14 2003
STATUS
approved