login
A157829
Numbers k such that k! - (k-1)! + (k-2)! + 1 is prime.
0
2, 5, 7, 11, 13, 16, 22, 29, 43, 56, 67, 83, 85, 107, 317, 325, 517, 1660, 2010, 2368, 4483, 4697
OFFSET
1,1
EXAMPLE
a(11) = 11! - 10! + 9! + 1 = 36650881 (prime).
a(16) = 16! - 15! + 14! + 1 = 19702293811201 (prime).
MAPLE
a := proc (n) if isprime(factorial(n-2)*((n-1)^2+1)+1) = true then n else end if end proc: seq(a(n), n = 2 .. 700); # Emeric Deutsch, Mar 18 2009
PROG
(PARI) is(n)=ispseudoprime(1+(n^2-2*n+2)*(n-2)!) \\ Charles R Greathouse IV, Dec 27 2013
(PFGW) ABC2 $a!-($a-1)!+($a-2)!+1
a: from 2 to 10000
CROSSREFS
Sequence in context: A191406 A322969 A229470 * A020581 A081259 A177512
KEYWORD
nonn
AUTHOR
Kyle D. Balliet, Mar 07 2009
EXTENSIONS
More terms from Emeric Deutsch, Mar 18 2009
a(18)-a(22) from Charles R Greathouse IV, Dec 27 2013
STATUS
approved