![]() |
The fastest primality test for Fermat numbers.
The test states that for n > 2,
F(n) is prime iff 5^((F(n)-1)/4) == sqrt(F(n)-1) (mod F(n)). <Thread posted on April 01, 2011. :judge: |
[QUOTE=Arkadiusz;257308]The test states that for n > 2,
F(n) is prime iff 5^((F(n)-1)/4) == sqrt(F(n)-1) (mod F(n)). <Thread posted on April 01, 2011. :judge:[/QUOTE] it says the date already: so you say: 5^(2^(2^n-2)) mod (2^(2^n)+1) = 2^((2^n)/2) according to my research. I'll have to think on this more, I'm not that advanced. |
[QUOTE=science_man_88;257315]it says the date already:
so you say: 5^(2^(2^n-2)) mod (2^(2^n)+1) = 2^((2^n)/2) according to my research. I'll have to think on this more, I'm not that advanced.[/QUOTE] 5^(2^(n+1)-4) mod (2^(2^n)+1) = 2^(2^(n-1)) is what I've worked it down to. |
[QUOTE=science_man_88;257320]5^(2^(n+1)-4) mod (2^(2^n)+1) = 2^(2^(n-1)) is what I've worked it down to.[/QUOTE]
which I believe simplifies to 5^(2n-2) mod (2^(2^n)+1) = 2^(2n-2). though I'm not great at remembering math when I want it. |
[QUOTE=science_man_88;257324]which I believe simplifies to 5^(2n-2) mod (2^(2^n)+1) = 2^(2n-2). though I'm not great at remembering math when I want it.[/QUOTE]
okay I have to remember things better. |
[CODE](13:56)>for(n=1,100,print1(isprime(F(n))","))
1,1,1,1,0,0,0,0,0,0,0,0,0, *** isprime: user interrupt after 15,468 ms. (13:57)>for(n=1,100,print1(5^((F(n)-1)/4)%(F(n)) == sqrt(F(n)-1)",")) 0,0,1,1, *** _^_: user interrupt after 12,782 ms.[/CODE] F(n)= 2^(2^n)+1 it fails twice in the first 4. |
[QUOTE=science_man_88;257691][CODE](13:56)>for(n=1,100,print1(isprime(F(n))","))
1,1,1,1,0,0,0,0,0,0,0,0,0, *** isprime: user interrupt after 15,468 ms. (13:57)>for(n=1,100,print1(5^((F(n)-1)/4)%(F(n)) == sqrt(F(n)-1)",")) 0,0,1,1, *** _^_: user interrupt after 12,782 ms.[/CODE] F(n)= 2^(2^n)+1 it fails twice in the first 4.[/QUOTE] forgot the n>2 part |
| All times are UTC. The time now is 11:56. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.