 mersenneforum.org > Math Subfactorial primes
 Register FAQ Search Today's Posts Mark Forums Read  2008-06-17, 13:30 #1 Housemouse   Feb 2008 2016 Posts Subfactorial primes !3 = 2 is the only subfactorial prime !2+1 = 2 !3+1 = 3 !5-1 = 43 Any other !N +1 or !N - 1 that are prime?   2008-06-17, 14:41   #2
R.D. Silverman

Nov 2003

746010 Posts Quote:
 Originally Posted by Housemouse !3 = 2 is the only subfactorial prime !2+1 = 2 !3+1 = 3 !5-1 = 43 Any other !N +1 or !N - 1 that are prime?
They should form a very thin infinite set.   2008-06-17, 17:00   #3
rogue

"Mark"
Apr 2003
Between here and the

22·1,607 Posts Quote:
 Originally Posted by Housemouse !3 = 2 is the only subfactorial prime !2+1 = 2 !3+1 = 3 !5-1 = 43 Any other !N +1 or !N - 1 that are prime?
Based upon this post, I'm not clear what a "subfactorial" prime is.   2008-06-17, 17:09 #4 Housemouse   Feb 2008 25 Posts N subfactorial, designated !N is calculted as follows: N! * (1-1/1!+1/2!-1/3!+1/4!.....1/n!) !1 = 0 !2 = 1 !3 = 2 !4 = 9 !5 = 44 !6 = 265   2008-06-17, 18:00   #5
xilman
Bamboozled!

"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

253068 Posts Quote:
 Originally Posted by rogue Based upon this post, I'm not clear what a "subfactorial" prime is.
Neither was I, but Google quickly told me.

Paul   2008-06-17, 18:15   #6
fivemack
(loop (#_fork))

Feb 2006
Cambridge, England

3·19·113 Posts Quote:
 Originally Posted by Housemouse N subfactorial, designated !N is calculated as follows: N! * (1-1/1!+1/2!-1/3!+1/4!.....1/n!) !1 = 0 !2 = 1 !3 = 2 !4 = 9 !5 = 44 !6 = 265
OK, by that definition and standard properties of alternating sequences it's also nearest_integer(exp(-1) * factorial(N))

Bring out gp:
Code:
for(t=10,264,s=floor(exp(-1)*factorial(t)+0.5);for(j=-3,3,if(isprime(s+j),print([t,j]))))
says
Code:
[11, -3]
[15, -1]
[17, -1]
[21, 3]
[149, -3]
[173, -3]
[185, 3]
[202,-2]
[264,-2]   2008-06-17, 19:57 #7 ATH Einyen   Dec 2003 Denmark 52·127 Posts Another formula: !n = Floor((n!+1)/e) for n>=1 Last fiddled with by ATH on 2008-06-17 at 20:02   2008-06-18, 12:15 #8 Jens K Andersen   Feb 2006 Denmark E616 Posts If N is even then N divides !N-1, and !N+1 is even. If N is odd then N divides !N+1. That leaves !N-1 for odd N. The only primes for N<=10000: !5-1 = 43 !15-1 = 481066515733 !17-1 = 130850092279663 These were already computed by http://www.research.att.com/~njas/sequences/A100015 and fivemack. I'm continuing to 20000. Candidates are computed by PARI/GP and tested by PrimeForm/GW. Like R.D. Silverman, I expect infinitely many but rare primes.   2008-06-18, 15:03 #9 alpertron   Aug 2002 Buenos Aires, Argentina 22×3×5×23 Posts I think it is best to use a sieve to discard many candidates. I will prove that . Let N = mp+n (0<=n 2008-06-18, 15:41 #10 alpertron   Aug 2002 Buenos Aires, Argentina 22·3·5·23 Posts For example, in the case !N-1 we have the following zeros: p = 2 -> N = 0 (mod 2) p = 3 -> N = 0, 2 (mod 6) p = 5 -> N = 0, 2, 9 (mod 10) p = 7 -> N = 0, 2, 13 (mod 14) p = 11 -> N = 0, 2, 6, 10 (mod 22) etc. So for these congruences of N, !N-1 is composite. Of course the even values are not needed because they are already covered by the case p=2. Other values of N for which !N-1 is composite: p=5 -> N = 9 (mod 10) p=7 -> N = 13 (mod 14) p=17 -> N = 7 (mod 34) p=19 -> N = 13, 25 (mod 38) p=23 -> N = 19 (mod 46) p=29 -> N = 49 (mod 58) p=43 -> N = 5 (mod 86) (of course when N=5, !N-1 is prime). p=47 -> N = 27 (mod 94) p=59 -> N = 11 (mod 118) p=67 -> N = 63, 81 (mod 134) p=73 -> N = 121 (mod 146) p=79 -> N = 109, 115 (mod 158) p=89 -> N = 103 (mod 178) p=97 -> N = 179 (mod 194) Last fiddled with by alpertron on 2008-06-18 at 15:55   2008-06-18, 21:26 #11 Jens K Andersen   Feb 2006 Denmark E616 Posts I'm stopping when 20000 is reached. This is a one day search and I'm not implementing a sieve. I also think the advantage would be quite small. The primes which divide more than one value up to !20000 are so small that only little trial factoring would be spared. A trial factoring program using !n = n * !(n-1) + (-1)^n would probably be a better use of programming time but I'm not doing that either.   Thread Tools Show Printable Version Email this Page Similar Threads Thread Thread Starter Forum Replies Last Post carpetpool Miscellaneous Math 3 2017-08-10 13:47 emily Math 34 2017-07-16 18:44 Mickey1 Miscellaneous Math 1 2013-05-30 12:32 Unregistered Information & Answers 0 2011-01-31 15:41 troels munkner Miscellaneous Math 4 2006-06-02 08:35

All times are UTC. The time now is 12:09.

Tue Oct 19 12:09:04 UTC 2021 up 88 days, 6:38, 0 users, load averages: 1.33, 1.43, 1.39