Skip to content

Instantly share code, notes, and snippets.

@primus-lab
primus-lab / bhaskara.py
Created January 5, 2020 18:33
Primality test
# Author: Pedja
print(" ***** BHASKARA *****\n\n\n")
while True:
@primus-lab
primus-lab / proth.py
Created January 6, 2020 08:09
Primality test for specific class of Proth numbers
# Author: Pedja
print(" ***** PROTH *****\n\n\n")
while True:
@primus-lab
primus-lab / LLRT.py
Last active February 23, 2020 08:39
Conjectured primality test for numbers of the form 2kp^n +/- 1
'''
This script was written in python 3.x.
In order to run this script, please make sure your python version is 3.x or above.
How to run:
python LLRT.py
or if it doesn't work use this one:
python3 LLRT.py
Author: Pedja Terzic <[email protected]>
'''
from sympy import *
"""
formula.py - propositional formulas for Python
by Robin Wellner
Hereby, I waive all rights to this library, as described at <http://creativecommons.org/publicdomain/zero/1.0/>
Examples:
foo = Atom('foo')
bar = Atom('bar')
disjuction = foo | bar
conjunction = foo & bar
implication = foo >> bar