View Single Post
Old 2020-05-15, 18:39   #16
carpetpool's Avatar
Nov 2016

31610 Posts

Originally Posted by drmurat View Post
okay . I am not plannig to improve my coding . I am behind so many thing about primes . I am medical doctor . I know a bit coding . and intrested in with primes nearly 20 mounths .I do my calculations with my own . it has to reason fitst when I need data fot one process . getting whole data is hard . you must open so many zip files . make them as you want . it gets so time . the second reason making calculation with your own gives you a chance of oservation . I am asking here to calculating 2 ^70000 is hard . I realy dont know the answer .
You seem to have the right idea. You want to calculate 2^n for some integer n. However, this integer n is the one you want to test for primality, and not even 2^n, but 2^n mod n. (n may have, thousands, millions, and maybe even a billion digits). Look up modular or binary exponentiation.

If a does not divide n, n is prime --> a^n = a mod n --> a^(n-1) = 1 mod n

What happens when n is composite?

Last fiddled with by carpetpool on 2020-05-15 at 18:39
carpetpool is offline   Reply With Quote