Okay, so I wrote a program to try and factor a number. The small numbers that I am using to test are 11 and 31. Those, multiplied together are 341. So I am trying to factor 341, as a test.

So, when I ran my program, I got 17. Weird number, right? Well actually, there is some interesting math with it:

31-17=14

17-14=3

11+17=28

31-28=3

So the 3 is the same. What I want to know, is what is that number 3? In other words, I don't know the factors, I only know the number 17. I also know that with the two factors, f_{1} and f_{2}, and the program I wrote output the number P, It seems to be true that:

f_{2}-P-f_{1} = f_{2}-(f_{1}+P) = f_{2}-f_{1}-P

(In this case, it is all 3.)

If I find that number, that makes them all equal, I can find the factors. Any suggestions?

So far, I have found that 341/17 is about 20, which is f_{2}-f_{1}, which means f_{2}-f_{1}-P is my mystery number. I don't know if it works for all numbers, but… I will check.