Dec-03-2019, 11:05 PM
(This post was last modified: Dec-03-2019, 11:05 PM by Pleiades. Edited 1 time in total.)

Hi,

I have been struggling with this code for four weeks and I cannot seem to rap my head around how to search for certain numbers after I run the code in python37. I can return factors for numbers I'm searching for but only if I type in a specific number. For instance if I want to see a print out of a factor for 2**11-1 which equals 23 I have to type in 2.

I do have two pieces of code the second piece allows you to see the range of items in the list and you can print factors for Non-Mersenne Primes!

Can someone help me the the second piece of code for subtraction and division? So I can output this in an automated fashion:)

Say you need to know the math for 1682 using P=29 then P=29**2*2 = 1682

I have been struggling with this code for four weeks and I cannot seem to rap my head around how to search for certain numbers after I run the code in python37. I can return factors for numbers I'm searching for but only if I type in a specific number. For instance if I want to see a print out of a factor for 2**11-1 which equals 23 I have to type in 2.

I do have two pieces of code the second piece allows you to see the range of items in the list and you can print factors for Non-Mersenne Primes!

Can someone help me the the second piece of code for subtraction and division? So I can output this in an automated fashion:)

Say you need to know the math for 1682 using P=29 then P=29**2*2 = 1682

'''A program which identifies factors of non-Mersenne Primes(other than 1 and itself), when a prime uses 2^p-1 ''' while True: composites=[] list1z = composites p = int(input('Enter a prime number to test for a factor : ')) y = int(input('Enter the start range if your going for big factors make a large number: ')) n = int(input("Enter the end range : ")) # e = int(input('Enter the end range if your going for big factors make a large number: ')) positive_n = abs(n) for num in range(positive_n+1): if num > 1: for i in range(1, num,1): if (num % i) == 0: if n > 0: composites.append(num) else: composites.append(-num) break j = ((((((num*p+1)*p)+p)//p)//p)) list1z = composites # print("\ncomposites from {} to {} \n list1z = {}".format(int(positive_n/n), n, list1z)) list1z = composites # print("\ncomposites from {} to {} \n list1z = {}".format(int(positive_n/n), n, ([str(i) for i in list1z]))) # print([str(i) for i in list1z]) final_list = list() for index, i in enumerate(list1z): final_list.append(index) final_list.append(i) list1z = composites print("\ncomposites from {} to {} \n list1z = {}".format(int(positive_n/n), n, final_list)) list1z == [(((((num*p+1)*p)+p)//p))] if (((((num*p+1)*p)+p)//p//p)) in list1z: print ((((((num*p+1)*p)+p)//p)-2)+1) n = (((((num*p+1)*p)+p)//p//p)) # while n > 0: # print(list1z.pop(+(((((num*p+1)*p)+p)//p//p)) ))

'''Input a prime number P, Subtract all numbers in left column by P, then divide all numbers by far right column, if you find a non fraction to come up first in the list then that number is a non_Mersenne Prime Number which does not produce a prime number according to this formula 2^p-1 and the middle number is the factor!!!! Happy Hunting, Merry Christmas from Tom O'Neil 2019 copyright all Mersenne Primes reserved on tap :)''' print('''Input a prime number P, Subtract all numbers in left column by P, then divide all numbers by far right column, if you find a non fraction to come up first in the list then that number is a non_Mersenne Prime Number which does not produce a prime number according to this formula 2^p-1 and the middle number is the factor!!!! Happy Hunting, Merry Christmas from Tom O'Neil 2019 copyright all Mersenne Primes reserved on tap :)''') import math while True: list_factors ={} list_numbers = {} list_a = [] p = int(input('Enter a prime number to test ratio : ')) a = (1) g = ((p**3//(.5*p)//2)) k = ((((p**3//(.5*p))))) c = ((((p**3//(.5*p)//(.5*p))))) d = ((((p**3//(.5*p)//(.5*p)*2)-2))) o = (((2*p/(p**3//(.5*p)//(.5*p)//(.5*p))))) r = ((((p**3//(.5*p)//(.5*p)//(.5*p))))) m = ((((k-(((p**3//(.5*p)//(.5*p)))*o))//(p)))) s = (round((((p*c))/p**3*100))) t = (round((((3+k+2*c))/p**3*100))) l = (p//((2)//2)) y = int(input('Enter the start range if your going for big factors make a large number: ')) e = int(input('Enter the end range if your going for big factors make a large number: ')) # print (o*r) # print((p/2/2//2)) h = ((p/2/2//2)) print(p) # print(o) for i in range(y,e): new_values = { i : ((i*p+1))} new_valuesf = {(((((i*p+1))*p))) : (((((i*p+1))))) } list_factors.update(new_valuesf) for item in new_valuesf: if item == (((((i*p+1))*p))): list_numbers.update(new_values) print((new_valuesf) , ((k/i)*i)) ([((int(i)-z) % (z*z)) if isinstance(i, str) else i for i in new_values])