OFFSET
1,2
COMMENTS
If n=3, then 3*2^3-2*3^2+1=7 is prime, so 7 is not in this sequence. If n=5, then 5*4^5-4*5^4+1=2621 is prime.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..377
MATHEMATICA
Union[Select[Table[n(n-1)^n-(n-1)n^(n-1)+1, {n, 30}], !PrimeQ[#]&]] (* Harvey P. Dale, Jun 19 2011 *)
PROG
(Magma) [ a: n in [2..40] | not IsPrime(a) where a is n*(n-1)^n-(n-1)*n^(n-1)+1 ]; // Vincenzo Librandi, Jun 13 2011
(PARI) for(n=1, 1e3, if(!ispseudoprime(k=n*(n-1)^n-(n-1)*n^(n-1)+1), print1(k", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jun 12 2011
STATUS
approved