[HP35s] Program for prime number (Wheel Sieve and Miller-Rabin)
|
02-16-2019, 10:32 PM
(This post was last modified: 02-16-2019 10:40 PM by Albert Chan.)
Post: #39
|
|||
|
|||
RE: [HP35s] Program for prime number (brut force)
(02-16-2019 05:57 PM)Thomas Klemm Wrote: Before n is strong pseduoprime, it must be a Fermat pseduoprime. Let p1, ... pk be distinct prime factors of N: Number of bases (mod N) = gcd(p1-1, N-1) ... gcd(pk-1, N-1) So, picking top 2 numbers from the list: 1891 = 31 * 61, gcd(30, 1890) * gcd(60, 1890) = 30 * 30 = 900 8911 = 7*19*67, gcd(6, 8910) * gcd(18, 8910) * gcd(66, 8910) = 6 * 18 * 66 = 7128 No wonder so many strong pseudoprimes. Gerald H's example, N = 803189 * 485909 gcd(N-1, 803188) * gcd(N-1, 485908) = 4*4 = 16 Removing 2 trivial bases of ±1, you are down to 14 Some Fermat pseudoprimes might not survive the strong test, so possibly few strong pseudoprimes. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 11 Guest(s)