[HP35s] Program for prime number (Wheel Sieve and Miller-Rabin)
|
02-14-2019, 06:26 PM
Post: #14
|
|||
|
|||
RE: [HP35s] Program for prime number (brut force)
What happens if you do not check each remainder goes to zero, but collect it all per turns ?
If product of the turn remainders reached zero, it meant you hit a factor there. You do not even have to check 2,3,5,7 ! Like this: Code: r = (n % 2) * (n % 3) * (n % 5) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 15 Guest(s)