mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Math (https://www.mersenneforum.org/forumdisplay.php?f=8)
-   -   The fastest primality test for Fermat numbers. (https://www.mersenneforum.org/showthread.php?t=15482)

Arkadiusz 2011-04-01 20:17

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:

science_man_88 2011-04-01 21:35

[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.

science_man_88 2011-04-01 23:39

[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.

science_man_88 2011-04-01 23:50

[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.

science_man_88 2011-04-02 00:11

[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.

science_man_88 2011-04-05 16:58

[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.

science_man_88 2011-04-05 19:39

[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.