I want to multiply an integer with all the numbers in a list I generate until a value of 65 is reached. I am starting off at 2(first prime) and multiply up to 63(again all primes) until I reach 65. If a value is not reached with 2 I then want it to try with 3, and so on until the correct value us reached. I am doing this in python, which I am new too aswell so I apologise if this is basic. I then want to print out the numbers which multiplied together to give me that value, i.e. I know 5 and 13 would give me 65. Here is some of my code below:
from __future__ import division
import fractions
ml = []
nl = []
p = 5
q = 17
d = 0
x = 2
y = 2
z = (p-1)*(q-1)
print z
n = p*q
print n
for x in range(z):
if (fractions.gcd(x, z) == 1):
ml.append(x)
##print ml
s = 1
for x in ml:
t = s * x
if t == 65:
print s
print x
break
else:
s = s + 1