Tuesday, June 27, 2006

 

SF: Tandem factorization back, new approach

Sorry but this is how the development process works with me.

I went down one path before, found out it didn't work like I thought it did, so I called crap crap and started feeling sorry for myself. Then I thought of another approach, so here we go, again.

The idea here is to use a tandem factorization of two numbers where

S = (k_1*sqrt(x) + k_2*sqrt(y))*(k_3*sqrt(x) + k_4*sqrt(y))

and

T = (k_1*sqrt(x) - k_2*sqrt(y))*(k_3*sqrt(x) - k_4*sqrt(y))

which means that

2*sqrt(x)*k_1 = f_1 + g_1
2*sqrt(y)*k_2 = f_1 - g_1
2*sqrt(x)*k_3 = f_2 + g_2
2*sqrt(y)*k_4 = f_2 - g_2

and the initial approach I put forward was with a target composite T to factor you pick some surrogate S, and I had various ideas for how you then find all the other variables—when for that idea to work, you need to already know the factorization of S and T.

So that was when I was ready to toss all of this and declared it crap.

However, why pick S?

Using the first two equations I have

S - T = 2*(k_2*k_3 + k_1*k_4)*sqrt(xy)

and

S+T = 2*k_1*k_3*x + 2*k_2*k_4*y

and focusing on that second equation if I let

k_1*k_3 = A

k_2*k_4 = B

and pick squares for x and y, then I determine S, if T is the target factorization:


S = 2*k_1*k_3*x + 2*k_2*k_4*y - T

so


S = 2*A*x + 2*B*y - T

and you can use those equations to solve out two of the k's, and substitute out S, to relate the remaining two k's in an equation that I hope will give the approach that works.

>From that equation the idea is you figure out how to pick A and B such that everything is an integer, and that gives you S, with S, you have integer k's and an incidental factorization of T, if it works.

I'll have to work through the equations and see if it is another crapshoot.

Ok, so making that substitution into the first equation I have

2A*x + 2*B*y - 2T = 2*(k_2*k_3 + k_1*k_4)*sqrt(xy)

and now I can solve out two of the k's, and divide by 2 to get

A*x + B*y - T =(k_2*(A/k_1) + k_1*(B/k_2))*sqrt(xy)

where there were a couple of possible ways to substitute out and I just picked one.

Now multiplying both sides by k_1*k_2 gives

(A*x + B*y - T)*k_1*k_2 = (A*k_2^2 + B*k_1^2)*sqrt(xy)

so I have

A*sqrt(xy)*k_2^2 - (A*x + B*y - T)*k_1*k_2 + B*sqrt(xy)*k_1^2 = 0

and completing the square with respect to k_2, I have

A*sqrt(xy)*k_2^2 - (A*x + B*y - T)*k_1*k_2 + (A*x + B*y - T)^2*k_1^2/(4A*sqrt(xy)) + B*sqrt(xy)*k_1^2 = (A*x + B*y - T)^2*k_1^2/(4A*sqrt(xy))

multiplying both sides by 4*A*sqrt(xy), and simplifying a bit gives

(A*sqrt(xy)*k_2 - (A*x + B*y - T)*k_1)^2 + 4*A* B*(xy)*k_1^2 = (A*x + B*y - T)^2*k_1^2

which is

(A*sqrt(xy)*k_2 - (A*x + B*y - T)*k_1)^2 = ((A*x - B*y)^2 - 2T(A*x+B*y) + T^2)*k_1^2

which yuck, shows that I need to know the factorization of T, to know how to pick A and B, so that

((A*x - B*y)^2 - 2T(A*x+B*y) + T^2)

and you need the factorization of B and T, or A and T to go further so it's another crap idea.

Went in a big freaking circle, again.

Maybe, maybe not. After all, I have

S = 2*A*x + 2*B*y - T

so what if I just decide that S is the target?

Then I need to solve out further with

(A*sqrt(xy)*k_2 - (A*x + B*y - T)*k_1)^2 = ((A*x - B*y)^2 - 2T(A*x+B*y) + T^2)*k_1^2

as that is

(A*sqrt(xy)*k_2 - (A*x + B*y - T)*k_1)^2 = ((A*x - B*y - T)^2 - 4T*B*y)*k_1^2

and if I just pick B and T, as surrogates, and assume I know the factorizations

a_1 * a_2 = B*y, and b_1*b_2 = T, then I have

A*x = B*y + T + a_1*b_1 + a_2*b_2

and I can now substitute to find that S is given by

S = 4*B*y + T + 2*a_1*b_1 + 2*a_2*b_2

and making my substitutions that is

S = 4*y*a_1 * a_2 + b_1*b_2 + 2*a_1*b_1 + 2*a_2*b_2

and let's collect with respect to the a's, so I have

S = 4*y*a_1 * a_2 + 2*a_1*b_1 + b_1*b_2 + 2*a_2*b_2

and simplify to get

S - b_1*b_2 - 2*a_2*b_2 = (4*y* a_2 + 2*b_1)*a_1

so I have finally that

a_1 = (S - b_1*b_2 - 2*a_2*b_2)/(4*y* a_2 + 2*b_1)

and it looks like I can just pick b_1 and b_2, and then I just need to look for integer values for a_2 such that a_1 is an integer.

One last thing to do then, with

4*y* a_2 + 2*b_1 = h_1

then

4*y* a_2 + 2*b_1 = 0 mod h_1

S - b_1*b_2 - 2*a_2*b_2 = 0 mod h_1

so multiplying the first by -2*b_2 and the second by 4*y, I have

-8*y*b_2* a_2 - 4*b_1*b_2 = 0 mod h_1

4*y*S - 4*y* b_1*b_2 - 8*y*a_2*b_2 = 0 mod h_1

and subtracting the top one from the bottom one I get

4*y*S - 4*y* b_1*b_2 + 4*b_1*b_2= 0 mod h_1

which is a surpise to me, as it looks like if I go ahead and use b_1*b_2 = T, I just have

4*y*S + 4*T*(y-1)= 0 mod h_1

whci is the kind of result I don't believe in (thinking I made an algebra mistake somewhere) as it says that if y = 1, then you need the factorization of S, but otherwise, you can factor this other thing.

Going back over it to find someplace where I left off y…

Didn't see it on a quick run back, but I guess I'll find something later. In any event, will post in the meantime!

Of course, if by some chance I did the algebra right, then you have this odd result that you need to pick a square for y other than 1, like y=4, and then the damn thing will work!

But that seems too arbitrary, so I must have made a mistake somewhere?

That was dumb. That's why y is in at the end, as I put it in here when it was substituted out.

Corrected it goes as follows.

and let's collect with respect to the a's, so I have

S = 4*a_1 * a_2 + 2*a_1*b_1 + b_1*b_2 + 2*a_2*b_2

and simplify to get

S - b_1*b_2 - 2*a_2*b_2 = (4* a_2 + 2*b_1)*a_1

so I have finally that

a_1 = (S - b_1*b_2 - 2*a_2*b_2)/(4a_2 + 2*b_1)

and it looks like I can just pick b_1 and b_2, and then I just need to look for integer values for a_2 such that a_1 is an integer.

One last thing to do then, with

4a_2 + 2*b_1 = h_1

then

4a_2 + 2*b_1 = 0 mod h_1

S - b_1*b_2 - 2*a_2*b_2 = 0 mod h_1

so multiplying the first by -2*b_2 and the second by 4, I have

-8b_2* a_2 - 4*b_1*b_2 = 0 mod h_1

4S - 4b_1*b_2 - 8*y*a_2*b_2 = 0 mod h_1

and subtracting the top one from the bottom one I get

4S = 0 mod h_1

so not surprisingly I need the factorization of S to go further so it's another big freaking circle.





<< Home

This page is powered by Blogger. Isn't yours?