Ask Your Question

Revision history [back]

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of y? Example function: x=0 y=0 ((3^x+2*y) in Primes()) test(x, x+100) I want it to run through x, x+100 at y=0, and then go to x, x+100 at y=1, all the way to y=5 without having to do each input from y=0 to y=5 on my own.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of y? Example function: lets say the variable "l"? For my code here: x=0 y=0 ((3^x+2*y) in Primes()) test(x, x+100) x=2336 y=2 z=80000 w=10 s=(2*x-w) t=x/w l=0 m=0 def a(x, i): return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l) | def what_im_looking_forb(min_range, max_range): for l in range(200): for i in range(min_range, max_range): if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True: print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)) what_im_looking_for(t,t+20000) I want it to run through x, x+100 t, t+20000 at y=0, l=0, and then go to x, x+100 t, t+20000 at y=1, l=1, all the way to y=5 l=200 without having to do each input from y=0 to y=5 l=0 to l=200 on my own. own.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here: x=2336 y=2 z=80000 w=10 s=(2*x-w) t=x/w l=0 m=0 def a(x, i): return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l)(floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l) def a2(x, i): return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m) | | def what_im_looking_forb(min_range, max_range): for l in range(200): for i in range(min_range, max_range): if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True: print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)) what_im_looking_for(t,t+20000) I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here: x=2336 y=2 z=80000 w=10 s=(2*x-w) t=x/w l=0 m=0 def a(x, i): return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l) def a2(x, i): return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m) | def what_im_looking_forb(min_range, max_range): for l in range(200): for i in range(min_range, max_range): if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True: print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)) what_im_looking_for(t,t+20000) I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own.own. Currently only loops on l=0 and not on multiple l values.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here: here:

x=2336
y=2
z=80000
w=10
s=(2*x-w)
t=x/w
l=0
m=0
def a(x, i):
    return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l)
def a2(x, i):
    return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m) i)))))-m)` | 
def `def what_im_looking_forb(min_range, max_range):
    for l in range(200):
        for i in range(min_range, max_range):
            if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True:
                print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1))i)+1))`
what_im_looking_for(t,t+20000)

what_im_looking_for(t,t+20000) 

I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own. Currently only loops on l=0 and not on multiple l values.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here:

x=2336
y=2
z=80000
w=10
s=(2*x-w)
t=x/w
l=0
m=0
def a(x, i):
    return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l)
def a2(x, i):
    return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m)` | 
`def what_im_looking_forb(min_range, max_range):
    for l in range(200):
        for i in range(min_range, max_range):
            if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True:
                print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1))`
i)+1))

what_im_looking_for(t,t+20000)

I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own. Currently only loops on l=0 and not on multiple l values.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here:

x=2336
y=2
z=80000
w=10
s=(2*x-w)
t=x/w
l=0
m=0
def a(x, i):
    return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l)
def a2(x, i):
    return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m)` | 
`def what_im_looking_forb(min_range, max_range):
    for l in range(200):
        for i in range(min_range, max_range):
            if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True:
                print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1))

what_im_looking_for(t,t+20000)

I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own. Currently only loops on l=0 and not on multiple l values.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here:

x=2336
y=2
z=80000
w=10
s=(2*x-w)
t=x/w
l=0
m=0
def a(x, i):
    return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l)
def a2(x, i):
    return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m)` | 
`def what_im_looking_forb(min_range, max_range):
    for l in range(200):
        for i in range(min_range, max_range):
            if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True:
                print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1))

what_im_looking_for(t,t+20000)

I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own. Currently only loops on l=0 and not on multiple l values.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here:

x=2336
y=2
z=80000
w=10
s=(2*x-w)
t=x/w
l=0
m=0
 def a(x, i):
    return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l)
 def a2(x, i):
    return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m)` | 
`def i)))))-m)

def what_im_looking_forb(min_range, max_range):
    for l in range(200):
        for i in range(min_range, max_range):
            if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True:
                print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1))

what_im_looking_for(t,t+20000)

I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own. Currently only loops on l=0 and not on multiple l values.

n-th prime factor and handling equations with multiple variables at once

Hello! I was wondering how to get the n-th factor of a number in such a way that I can work with it easily(Without it being in parenthesis as an example). For example, the 5th factor of 36 and in Sage I want to do (nth factor of 36)^2. Also, how does one have sage run code involving multiple variables with something like this without having to manually run it for each value of lets say the variable "l"? For my code here:

x=2336
y=2
z=80000
w=10
s=(2*x-w)
t=x/w
l=0
m=0

def a(x, i):
    return (floor(abs((y*x*(2*i+1)/(s*(2*i+2)-y*(x*(2*i+1))))))+l)

def a2(x, i):
    return (floor(abs((y*x*(2*i+1)*a(x, i))/(s*(2*i+2)*(a(x, i)+1)- y*(x*(2*i+1)*a(x, i)))))-m)

def what_im_looking_forb(min_range, max_range):
    for l in range(200):
        for i in range(min_range, max_range):
            if abs(s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*(a2(x, i)))<z and (a(x, i) in Primes())==True and (a2(x, i) in Primes())==True and ((2*i+1) in Primes())==True:
                print l, (2*i+1), x*(2*i+1), x*(2*i+1)*(a(x, i)), x*(2*i+1)*(a(x, i))*a2(x, i), s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1)-y*x*(2*i+1)*(a(x, i))*a2(x, i), gcd(x*(2*i+1)*(a(x, i))*(a2(x, i))*y,s*(2*i+2)*(a(x, i)+1)*(a2(x, i)+1))

what_im_looking_for(t,t+20000)

I want it to run through t, t+20000 at l=0, and then go to t, t+20000 at l=1, all the way to l=200 without having to do each input from l=0 to l=200 on my own. Currently only loops on l=0 and not on multiple l values.