public Form1()
{
InitializeComponent();
textBox1.Text = "56944483"; // 3683 14741
textBox2.Text = "44449";
textBox3.Text = "99991"; // find solution with 2446 try
}
{
InitializeComponent();
textBox1.Text = "56944483"; // 3683 14741
textBox2.Text = "44449";
textBox3.Text = "99991"; // find solution with 2446 try
}
private void button1_Click(object sender, EventArgs e)
{
long number = long.Parse(textBox1.Text);
long norm = (long)Math.Sqrt(number);
long norm2 = norm * norm;
int count = 0;
{
long number = long.Parse(textBox1.Text);
long norm = (long)Math.Sqrt(number);
long norm2 = norm * norm;
int count = 0;
int[] modj2 = new int[8] { 0, 1, 4, 9, 0, 9, 4, 1 }; // mod 16
int[] mod = new int[8];
int[] good = new int[8];
int[] mod = new int[8];
int[] good = new int[8];
label1.Text = "";
label2.Text = "";
for (int i = 1; i < 10; i++) // only search to sqrt(number)/3; or two factors are within 10 times of each other
{
bool found = false;
norm = (long)Math.Sqrt(number / i / 4);
norm = norm * 2; // base is even number
norm2 = norm * norm;
label2.Text = "";
for (int i = 1; i < 10; i++) // only search to sqrt(number)/3; or two factors are within 10 times of each other
{
bool found = false;
norm = (long)Math.Sqrt(number / i / 4);
norm = norm * 2; // base is even number
norm2 = norm * norm;
long k = number / norm2;
long m = (number - k * norm2) / norm;
long p = number - k * norm2 - m * norm;
long m = (number - k * norm2) / norm;
long p = number - k * norm2 - m * norm;
long xmax = (long)Mat