mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   ONeil (https://www.mersenneforum.org/forumdisplay.php?f=167)
-   -   Happy Eater Primes (https://www.mersenneforum.org/showthread.php?t=26240)

ONeil 2020-11-26 21:45

Happy Eater Primes
 
This code just gobbles up the Primes. So serve yourself up a tasty prime. Beware a learning curve so focus on the 0 EATER or 0 ZONE first!

When you see a ZERO next to EATER or ZONE then is a probable prime go through all the rules before checking its primality. After awhile you will get the hang of the left column and subtle rules. If anyone can improve the code post it here thanks.


:camping:

[CODE]import time
print('''If its easier to understand, start by looking at the ZONE or EATER, then read
all the rules! This code should weed out composite numbers and help
indicate Prime numbers or Twin Primes. The code works for a
0 ZONE or 0 EATER!''')
print('**********************************************************************************')

while True:
p = int(input('Is this number Prime?: '))
print('__________________________________________________')
if p % 2 and p % 5 != 0:



n = (((p - 1) % 9 + 1 if p else 0)-9)
s = (n*(-1))
u = (((p - 1+s) % 9 + 1 if p else 0))
m = ((((p - 1+s) % 9 + 1 if p else 0))+(((p - 1) % 9 + 1 if p else 0)-9))
j = (p+(((p - 1) % 9 + 1 if p else 0)-9)-1)
z = (((j - 1) % 9 + 1 if j else 0))
start_time = time.time()
print('___________________',p%7,p%3,'If Zero its a PSUEDO NUMBER, SOUL EXCEPTION 7 & 3')
print('If for a 0 EATER the two Top numbers are odd then number is PSUEDO and stop here')


print(m,'|TOP|Start of Column to left')
print(p%11,'If a 0 then number is a Psuedo Prime|Soul exception 11')

print('____________________')
print('If even in ZONE and EATER than Prime')
print('While only in ZONE and EATER if the only odd is a 3 in the left Column than input is _____Prime')
print(((p)+(p-1)+(p-2))%9,'|ZONE|Either a Prime or PSUEDO for a >Z E R O<')
print(((p)+(p+1)+(p+2))%9,'|EATER|Prime for >Z E R O< or PSUEDO NUMBERS')
print(((((p)+ (p-2)) %19)+((((p)+ (p+2)) %19)))%18,'| If ZONE and EATER ARE ONLY ODD THAN NUMBER IS PSUEDO PERIOD!')
print('_______',((((((p)+ (p-2)) %19)+((((p)+ (p+2)) %19)))%18)+(((p)+(p-1)+(p-2))%9))%5,'If a Zero input Not Prime, but if this number is TWO with the zero on left then prime',p%7,'<--<this is a 2')
print('________',p,'INPUTED NUMBER','____________')
print('BOTTOM')
print((((p)+ (p-2)) %19),'|')
print((((p)+ (p+2)) %19),'|If Zero then input not a Twin Prime|')
print((p%17),'|If Zero then input not a Twin Prime|LOWER PSUEDO NUMBER|Soul exception for 17')
print((p%19),'|If Zero then input not a Twin Prime|LOWER PSUEDO NUMBER|Soul exception for 19')
print('For a 0 ZONE IF BOTTOM contains number 3 or 7 and its the only odd in the Column at the __absolute _____bottom than input is Prime! If very bottom a 5 and bottom of top is 9 than input is Prime')
print('For a 0 ZONE if Bottom contains 3 odds from Top of Bottom that go from least to greatest than input is Prime| Also if Very top in Column is a 7 and at very bottom a 1 than input Prime')
print('For a 0 ZONE if Top has two odds than ____input is Prime')
print('BOTTOM')






e = int(time.time() - start_time)
print('___________________________________________')
print('{:02d}:{:02d}:{:02d}'.format(e // 3600, (e % 3600 // 60), e % 60))












[/CODE]

paulunderwood 2020-11-26 22:19

[COLOR="Red"][SIZE="4"]Moderator Note: Please confine your posts to your blogorrhea section[/SIZE][/COLOR]


All times are UTC. The time now is 06:21.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.