Skip to content

Commit f30519e

Browse files
committed
sq12: extend to minimum requirement for chain length 11
Except for some special cases handled separately, n cannot have 12 divisors if it is in {8,16,24} (mod 32), so chains of length 10 must match values [-2, -1, 0, 1, 2] (mod 32). But we're looking for chains of length 11 now, so we can add [-3, 3] (mod 32) to the list of requirements, and reduce the number of cases that need checking manually.
1 parent 61a86b7 commit f30519e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sq12.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ void tryvalue(mpz_t zv) {
181181
if (!is_taux(Z(temp), 12, 1))
182182
return;
183183
mpz_add_ui(Z(temp), Z(n32), 1);
184+
if (!is_taux(Z(temp), 12, 1))
185+
return;
186+
/* extend chain 10 to 11 */
187+
mpz_sub_ui(Z(temp), Z(n32), 3);
188+
if (!is_taux(Z(temp), 12, 1))
189+
return;
190+
mpz_add_ui(Z(temp), Z(n32), 3);
184191
if (!is_taux(Z(temp), 12, 1))
185192
return;
186193
keep_diag();

0 commit comments

Comments
 (0)