A064384 Primes p such that p divides 0!-1!+2!-3!+...+(-1)^{p-1}(p-1)!.
2, 5, 13, 37, 463
Offset: 1
Examples
5 is in the sequence because 5 is prime and it divides 0!-1!+2!-3!+4!=20.
References
- R. K. Guy, Unsolved Problems in Theory of Numbers, Springer-Verlag, Third Edition, 2004, B43.
Links
- Jonathan Sondow, The Taylor series for e and the primes 2, 5, 13, 37, 463: a surprising connection
- Jonathan Sondow and K. Schalm, Which partial sums of the Taylor series for e are convergents to e? (and a link to the primes 2, 5, 13, 37, 463), II, arXiv:0709.0671 [math.NT], 2007-2009.
- Index entries for sequences related to factorial numbers
Programs
-
Mathematica
Select[Select[Range[500], PrimeQ], (Mod[Sum[(-1)^(p - 1)*p!, {p, 2, # - 1}], #] == 0) &] (* Julien Kluge, Feb 13 2016 *) a[0] = 1; a[n_] := a[n] = n*a[n - 1] + 1; Select[Select[Range[500], PrimeQ], (Mod[a[# - 1], #] == 0) &] (* Julien Kluge, Feb 13 2016 with the sequence approach suggested by Jonathan Sondow *) Select[Prime[Range[500]],Divisible[AlternatingFactorial[#]-1,#]&] (* Harvey P. Dale, Jan 08 2021 *)
-
PARI
A=1;for(n=1,1000,if(isprime(n),if(Mod(A,n)==0,print(n)));A=n*A+1) \\ Jonathan Sondow, Dec 22 2006
Extensions
Edited by Max Alekseyev, Mar 05 2011
Comments