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