login
Primes of the form n^n - n! + 1.
3

%I #4 Jun 03 2014 09:30:43

%S 3,233,9996371201,11111919647266817

%N Primes of the form n^n - n! + 1.

%C The next term is too large to include.

%C 2^2-2!+1=4-2+1=3, 4^4-4!+1=256-24+1=233,..

%C The next term, a(5), has 527 digits and derives from n=224. - _Harvey P. Dale_, Jun 03 2014

%t f[n_]:=n^n-n!+1; lst={};Do[p=f[n];If[PrimeQ[p],AppendTo[lst,p]],{n,2*5!}];lst

%t Select[Table[n^n-n!+1,{n,30}],PrimeQ] (* _Harvey P. Dale_, Jun 03 2014 *)

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Jul 07 2009