>>5230
>>5230
>>5236
Alright guys, I've taken the iteration a bit further and am now including the (f-2)/40 for bigger jumps.
Please bear with me as I try to explain and forgive the small pics attached.
There are 2 variables that control the iteration process. The first, fm2_factor, is the number of (f-2)/40 chunks to include in the triangle base (u) (see the "#" column), and the second, rm_factor, is the number of chunks of (f-2)/40 to include in the remainder calculation (see the "r off" column).
The estimated (x+n)(x+n) square (est_XPN), is calculated as follows:
est_XPN = 1 + 8 * est_tu + ((f-2)%40) + (rm total)
where est_tu = T(fm2_factor * (f-2)/40)
and rm_total = 8 * (rm_factor * (f-2)/40) + ((f-2)%40)
The rm_total is only included if the rm_factor != 0.
Conceptually, we are creating a square from triangles and then adding chunks of (f-2)/40 around the square, checking for a match at each step.
In my previous example for c=87, the area around the square to check was simply u+1 and fit within the 4*(2(u+1)+1) perimeter. "For each u, there are 0 to u remainders possible."
For larger gaps in u, however, we need to expand the possible area for the remainder search to include up to the next possible u: (fm2_factor + 1) * (f-2)/40). See column "rm u" in the examples. Not accounting for this gap is what lead to inconsistent results in previous attempts.
The area that could possibly contain the remainder can be defined as follows:
remainder_max = 8 * (T(rm_u) - T(est_u))
This maximum remainder is essentially the "triangle base", and is necessary to know when to switch from iterating through a remainder to the next potential u. The "rm next" column is a calculation for the next total remainder.
rm_next = 8 * ( rm_factor + 1 ) * _fm2_chunk
When the next remainder is greater than the max possible remainder, the rm_factor is reset, and the fm2_factor is increased.
The pictures attached are various test cases from small to medium sized numbers, and are an attempt to illustrate that the process works, and that there are a couple of pitfalls that still need to be addressed. Number of iterations and elapsed time for each test are included.
Tests for 363, 6107, 7463 just show the process working for small numbers.
For 208975787, 208997671, and 209194627 note the additional iterations and processing time required for small values of f.
For 9872452111 and 9872801899, the starting fm2_factor of 0 enables searching of smaller values of n.
For 9874400051, the rm 2d(n-1) didn't equal zero, but the n0 value does equal the prime result. The concern here is that a minor adjustment to this algorithm needs to be made to tackle larger numbers and/or an additional validation method needs to be written.
This may or may not work for RSA sized numbers. The number of iterations required is still too large to effectively test. Most likely, we need another breakthrough with regards to the geometry of numbers to make this more efficient.