can this equation be solved algorithmicly

Linear, quadratic, module, parametric equations

can this equation be solved algorithmicly

Postby Guest » Sat Aug 25, 2018 10:56 am

4*x*y +2*x +2*y +1 = N
where N is an odd composite number?
here is my attempt
g = int(sqrt(N))
if g%2 = 0
g+=1
horizontal = 2*g
vertical = 2*g
g= g*g

while g != N:
if g >N
g-= horizontal
vertical -= 4
else
g += vertical
horizontal += 4
print vertical/2,horizontal/2

while this formula uses addition and subtraction to go though the possibilities rather than multiplication, it steps by such a low amount as to make it unwieldy
Guest
 

Return to Equations



Who is online

Users browsing this forum: No registered users and 1 guest