factorization and generalized Pell equation
In some cases if
N=p*q
3N=M=6G+3=(2a+1)^2-(2b)^2
then
3x^2-6x-4y^2-4y=M
it is true that (x+y)= p or -p
Example
N=55
3x^2-6x-4y^2-4y=165
solve 3x^2-6x-4y^2-4y=165 ,x
x-1=sqrt[(4y^2+4y+168)/3]
Y=2*y+1 ; X=x-1
->
Y^2-3*X^2=-167
X=8 ; Y=5
->
x=9 ; y=2
x+y=11
if we can transform a generic number W in polynomial time into 3N=3x^2-6x-4y^2-4*y with x+y=p or -p we have solved the factorization problem
so
If we can transorms a generic number W such that (2h+1)W
satisfies
3T^2-1 =3(2h+1)W+2
the factorization is quite easy
to do this I thought of looking for
3T^2-1 =3(2h+1)^2W+2
T^2-W(2h+1)^2=1
So it's Pell again
Example W=91
T^2-W(2h+1)^2=1
T^2-91(2h+1)^2=1
->
h=82
3x^2-6x-4y^2-4y=3(2h+1)^2*W
3x^2-6x-4y^2-4y=3(282+1)^2*91
Y^2-3X^2=-(3(2h+1)^2W+2)
Y^2-3X^2=-(3(282+1)^291+2)
->
Y=-1574 ; Y=1
->
x=-1573 ;y=0
gcd(1573,91)=13
Question:
To solve
T^2-W(2h+1)^2=1
and
Y^2-3X^2=-(3(2h+1)^2W+2)
What procedure does sagemath use?
And what is the computational cost?