20201115, 05:50  #1  
Dec 2017
240_{10} Posts 
"My Prime Verify Code"
Quote:
I believe this code is the first which can verify a prime which was used on input or if it was in the formula. So what I'm saying is this code will yield a 2 for 11 and a 2 for 2047 and I know 2047 is not prime however the formula uses ((2^111)+(2^111))%p and so 2047 is in there and was built by the prime number 11 so therefore a 2 so it is really for the 11. So if you happen to find a composite which yields a 2 then that composite number was built with a prime number any other 2's that are not composite are definitely prime! Very large numbers will cause memory issues, so if any python programmer out there know how to make this code work with a GPU which can utilize faster memory or more memory maybe that's is a work around. Maybe someone can optimize the code! https://youtu.be/_kRhgwg4258 Code:
import time start_time = time.time() print('''First prime Verify ever, if a Two its prime! Also here is the catch 2047 is a two and here is why 2^111, because this formula uses ((2^p1)+(2^p1))%p so a prime was used in the forumla therfore a two. Note important! There is a way to show its a composite number! If through division the counted number does not equal itself then the number used was composite like 2047 even tho the formula contained 11 and if the number contains a .5 it is 100% PRIME as long as a two is present! © Tom O'Neil''') while True: p = int(input("Enter a Prime Number: ")) if p % 2 !=0: m = (2**p1) prime = ((m + m)%p) result = 1 while p >= 1 : print(f'{result: <2}), {p}') p //= 2 result += 1 print('^Last counted number @ up arrow!') print('') print('If below multiplication number is odd then number is composite') print('Also if number has a .5 and the number to left is 2 then PRIME') print('If below multiplication number is Prime then entered number is prime') print('') print ((result/2 ,'Multiply this number if EVEN, by the last counted number, then divide by 2 until it equals the last counted number and if it equals the last counted number then prime' )) print('____________________________________') print(prime,'<< A two its prime or the number used was made by a prime') e = int(time.time()  start_time) print('{:02d}:{:02d}:{:02d}'.format(e // 3600, (e % 3600 // 60), e % 60)) Last fiddled with by ONeil on 20201115 at 05:55 Reason: vid not showing 

20201115, 06:07  #2 
Undefined
"The unspeakable one"
Jun 2006
My evil lair
29×211 Posts 

20201115, 06:27  #3  
Dec 2017
360_{8} Posts 
Quote:
Well my formula is not exactly like Fermat's right retina? Last fiddled with by ONeil on 20201115 at 06:32 

20201115, 06:34  #4 
"Curtis"
Feb 2005
Riverside, CA
3·1,579 Posts 

20201115, 07:00  #5 
Dec 2017
F0_{16} Posts 

20201115, 13:42  #6 
Feb 2017
Nowhere
5·19·47 Posts 
What does this code do with the input value 1105?

20201115, 14:45  #7 
Undefined
"The unspeakable one"
Jun 2006
My evil lair
29×211 Posts 

20201115, 15:20  #8  
Sep 2002
Database er0rr
E22_{16} Posts 
Quote:
1. Rubbish trial division of Mersennes 2. Enter a prime p and print out p+2 which might be a twin. 3. Enter a prime and do a fermat test on it. Wonders from the OP will never cease! Last fiddled with by paulunderwood on 20201115 at 15:28 

20201115, 16:36  #9  
Feb 2017
Nowhere
5·19·47 Posts 
Quote:
But to address your (presumably tongueincheek) point: The code doesn't forbid composite input. In fact, it has at least one instruction Code:
print('If below multiplication number is odd then number is composite') Good thing, too. Otherwise, someone could enter a composite value, and the whole universe might wink out of existence. So my question stands: What does this code do with the input 1105? 

20201115, 17:58  #10 
Dec 2017
2^{4}×3×5 Posts 
My system will prove its a composite number.
the last counted number is 11 multiply by 6 6x11=66 Now divide by 2 till you get 11 if you don't get 11 then 1105 is composite 66/2 = 33  33/2= 16.5 this shows that 1105 is composite. Please try better to break this program Dr Sardonicus I really think I found a way to show primes in a different way as well as defeat large composites. I know 1105 with mod 5 would should show 0 but I'm using my method right now. 
20201115, 18:37  #11 
"Curtis"
Feb 2005
Riverside, CA
3·1,579 Posts 
When asked what was different a few posts ago, you agreed nothing was different from a fermat test. So, when you now say "in a different way", do you just mean that your code is crap but the test is the same as Fermat?

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Prime numbers code broken  marsik84  Miscellaneous Math  6  20200430 20:27 
Prime Gap Search latest version of the c code  pinhodecarlos  Prime Gap Searches  170  20191210 19:33 
picking a prime to VERIFY below M(57,885,161)  ssybesma  Information & Answers  9  20181213 13:42 
Verify the existence of a large enough prime number?  Godzilla  Miscellaneous Math  25  20180928 17:10 
Code for testing a prime other than form 2^n1  MercPrime  Information & Answers  5  20130512 22:03 