Beispiel #1
0
from Data import Data
from LoadingBar import LoadingBar
data = Data()
twins = data.twinspec()
print len(data.ordells())
def is_prime(n):
  if n == 2 or n == 3: return True
  if n < 2 or n%2 == 0: return False
  if n < 9: return True
  if n%3 == 0: return False
  r = int(n**0.5)
  f = 5
  while f <= r:
    if n%f == 0: return False
    if n%(f+2) == 0: return False
    f +=6
  return True    
  
def gendata(n):
    w = open("primes1mod3.txt", "w+")
    i = 1
    while i <= n:
        if is_prime(i): w.write(str(i) + "\n")
        i = i + 3
    print "done"

#data = Data()
#primes = data.primes1mod3()

def sloanexy(p):
    found = 0
Beispiel #2
0
from Data import Data

data = Data()
elliptic = data.ordells()
twins = data.alltwins()
import math



def doexy(p):
    found = 0
    x = 0
    arr = []
    while x <= p:
        y = 0
        count = 0
        while y <= math.sqrt(p/7) + (p/2):
            n = (x*x) - (x*y) + 7*(y*y)
            if(n == p):
                count = count + 1
                arr.append([x,y])
                print x, y
            y = y+1
        x = x+1
    return arr



def runner():
    a = 0
    io = open("Noe's.txt", "w")
Beispiel #3
0
from Data import Data
from LoadingBar import LoadingBar
data = Data()
ells = data.ordells()
twins = data.twinspec()

def xyf(n):
    x = 0
    a= [0,0]
    while x < n:
        y = 0
        while y < n:
            if(((x*x) + (x*y) + (y*y)) == n):
                a = [x,y]
            y = y+ 1
        x = x+ 1
    return a


def finder():
    i =0
    io = open("CubanXandYforTwins.txt", "w+")
    lmao = open("CubanXandYforNOTTwins.txt", "w+")
    io.write("x  ,  y    for the equation (x^3-y^3)/(x-y) \n")
    io.write("These are both elliptic and cuban")
    lmao.write("x  ,  y    for the equation (x^3-y^3)/(x-y) \n")
    lmao.write("These are elliptic but not twins")
    while i < len(ells):
        temp = int(ells[i])
        arr = xyf(temp)
        if temp in twins and temp in ells: