# Primality Test and Factorization with Pythagorean triples and quadratic diophantine

#### gerva

A Pythagorean triple (A,b,c) with a minor cateto A odd always admits a solution (A,b,b+1) where 2*b+1=A^2

For example, let N be a semiprimo N=p*q

then N/1, N/N, N/p, N/q will be our four paths

then (N/q+1)/2 or (N/q-1)/2 will be odd

then

or

to keep in mind that the roads that can be traveled as mentioned above are four N/1, N/N, N/p, N/q so there will be four right paths

reiterating we will arrive at b=0 and find the solution q

example N=67586227

solve ((((((((((((((67586227/q+1)/2-1)/2-1)/2-1)/2-1)/2)-1)/2+1)/2+1)/2-1)/2+1)/2-1)/2-1)/2)^2+b^2=(b+1)^2 , b=0

the quadratic diophantine parabolic case are obtained thus

solve ((67586227/q+1)/2)^2+b^2=(b+1)^2 , b

b=(4567898080095529 + 135172454*q - 3*q^2)/(8*q^2)

this number 4567898080095529=N^2

this number 135172454/N= integer =2

as N=p*q

then

8*b=(N^2)/(q^2)+(2*N)/(q)-3

then

8*b=p^2+2*p-3 if it admits solutions we are on a right path

What do you think of this?

#### gerva

then N/1, N/N, N/p, N/q will be our four paths
thanks to Lutz Donnerhacke
I make this change