20201130, 23:52  #1 
Dec 2017
240_{10} Posts 
Semiprime and Prime Generator
MODERATOR NOTE: Please confine your posts to your blog area.
This is very interesting, because the output is always a Prime number or a Semiprime number. My Python code is very special for all you who thought numerology was a lost cause. I say that the cranks can find something every once in a while. So to all you Grinch's out there don't count me out yet lol. Code:
import time while True: p = int(input('Enter a number greater than zero: ')) print('__________________________________________________') n = (((p  1) % 9 + 1 if p else 0)) s = ((((p+2)  1) % 9 + 1 if p else 0)) start_time = time.time() print((n*s)1,'Is this number a Semiprime or Prime Number?') e = int(time.time()  start_time) print('___________________________________________') print('{:02d}:{:02d}:{:02d}'.format(e // 3600, (e % 3600 // 60), e % 60)) Last fiddled with by ONeil on 20201201 at 00:58 Reason: Moderator note 
20201201, 03:47  #2 
"Dylan"
Mar 2017
586_{10} Posts 
Indeed your code does indeed produce a prime or semiprime for any positive input:
I modified your code a bit: Code:
import time p = 1 start_time = time.time() while p <= 1000: n = (((p  1) % 9 + 1 if p else 0)) s = ((((p+2)  1) % 9 + 1 if p else 0)) print(p, n, s, (n*s)1) p += 1 e = int(time.time()start_time) print('{:02d}:{:02d}:{:02d}'.format(e // 3600, (e % 3600 // 60), e % 60)) Code:
2 7 14 23 34 47 62 7 17 Now, is this a profound result? No, it's not, but it's cool, I guess. 
20201201, 04:14  #3 
Dec 2017
2^{4}·3·5 Posts 
Thanks Dylan

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Semiprime and nalmost prime candidate for the k's with algebra for the Sierpinski/Riesel problem  sweety439  sweety439  11  20200923 01:42 
prime generator for f(n)=n^2+1  bhelmes  Miscellaneous Math  2  20160317 17:50 
New prime test (or generator)  synergy  Miscellaneous Math  39  20040921 17:10 
Prime Number Generator  Unregistered  Programming  6  20040321 01:00 
twin prime generator  1260  Math  13  20031012 09:48 