@@ -1609,16 +1609,27 @@ def solve_integer(self, n, *, algorithm="general"):
1609
1609
1610
1610
Also when using the ``"cornacchia"`` algorithm::
1611
1611
1612
- sage: abc = [1,0,randrange(1,10^3)]
1613
- sage: Q = BinaryQF(abc)
1614
1612
sage: n = random_prime(10^9)
1615
- sage: if Q[2] % 4 == 3 and randrange(2):
1616
- ....: n *= 4
1617
- sage: xy1 = Q.solve_integer(n, algorithm='cornacchia')
1618
- sage: xy1 is None or Q(*xy1) == n
1613
+ sage: c = randrange(1, 10^3)
1614
+
1615
+ sage: Q1 = BinaryQF(1, 0, c)
1616
+ sage: xy = Q1.solve_integer(n, algorithm='cornacchia')
1617
+ sage: xy is None or Q1(*xy) == n
1618
+ True
1619
+ sage: (xy is None) == (Q1.solve_integer(n) is None)
1620
+ True
1621
+
1622
+ sage: Q3 = BinaryQF(1, 0, 4*c+3)
1623
+ sage: xy = Q3.solve_integer(n, algorithm='cornacchia')
1624
+ sage: xy is None or Q3(*xy) == n
1625
+ True
1626
+ sage: (xy is None) == (Q3.solve_integer(n) is None)
1627
+ True
1628
+
1629
+ sage: xy = Q3.solve_integer(4*n, algorithm='cornacchia')
1630
+ sage: xy is None or Q3(*xy) == 4*n
1619
1631
True
1620
- sage: xy2 = Q.solve_integer(n)
1621
- sage: (xy1 is None) == (xy2 is None)
1632
+ sage: (xy is None) == (Q3.solve_integer(4*n) is None)
1622
1633
True
1623
1634
1624
1635
Test for square discriminants specifically (:trac:`33026`)::
0 commit comments