Skip to main content

Number One is Prime

Project description

1

Number One is Prime

Prime Numbers have Prime Property.
Prime Property is number One Property of indivisibility.
Number One is Prime.
Prime meaning is indivisible.

from random import randint
from time import sleep
from math import sqrt

def isPrime(n):
    ''' 
    Prime Numbers have Prime Property.
    Prime Property is number One Property of indivisibility.
    Number One is Prime.
    Prime meaning is indivisible.
    '''
    if n in [1, 2, 3, 5, 7]: return [1, n]
    elif n % 10 in [0, 2, 4, 5, 6, 8]: return 0
    a = int(sqrt(n))
    for i in range(0, a+1, 10):
        for j in [1, 3, 7, 9]:
            if (i+j) > 1 and n % (i+j) == 0: return 0
    return [1, n]

if __name__ == '__main__':

    tsec = 0.3
    while not 0:
        try:
            p = randint(1, 1)
            n = randint(1, pow(10, p))
            print('{:>15} : {}'.format(n, isPrime(n)))
            sleep(tsec)
        except Exception as e:
            print(e)
        else:
            pass
        finally:
            pass

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for 1-is-Prime, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size 1_is_Prime-0.0.0-py3-none-any.whl (2.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size 1-is-Prime-0.0.0.tar.gz (1.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page