Solving in Integers Nonlinear Systems of Equations by Computer

Jsun Yui Wong

The computer program listed below is about the following quotation from http://www.math.stackexchange.com [9]:

“Do there exist integers x, y, z, w that satisfy

(x+1)^2+y^2=(x+2)^2+z^2

(x+2)^2+z^2=(x+3)^2+w^2?”
0 REM DEFDBL A-Z

3 DEFINT J, K, X

4 DIM X(342), A(342), L(333), K(333), N(111), NN(111)

12 FOR JJJJ = -32000 TO 32000

14 RANDOMIZE JJJJ

16 M = -1D+317
91 FOR KK = 1 TO 4

94 A(KK) = -7000 + FIX(RND * 14001)
95 NEXT KK
128 FOR I = 1 TO 500000
129 FOR K = 1 TO 4
131 X(K) = A(K)
132 NEXT K
155 FOR IPP = 1 TO FIX(1 + RND * 3)
181 B = 1 + FIX(RND * 4)
182 REM IF RND < .5 THEN 183 ELSE GOTO 189
183 r = (1 – RND * 2) * A(B)

186 X(B) = A(B) + (RND ^ 3) * r

188 GOTO 191
189 IF RND < .5 THEN X(B) = A(B) – FIX(1 + RND * 1.99) ELSE X(B) = A(B) + FIX(1 + RND * 1.99)

191 NEXT IPP

603 N(91) = (X(1) + 1) ^ 2 + X(2) ^ 2 – (X(1) + 2) ^ 2 – X(3) ^ 2

606 N(92) = (X(1) + 2) ^ 2 + X(3) ^ 2 – (X(1) + 3) ^ 2 – X(4) ^ 2
1433 P = -ABS(N(91)) – ABS(N(92))
1499 IF P <= M THEN 1670
1657 FOR KEW = 1 TO 4
1658 A(KEW) = X(KEW)
1659 NEXT KEW
1661 M = P
1670 NEXT I
1888 IF M < -3 THEN 1999

1914 PRINT A(1), A(2), A(3), A(4), M, JJJJ

1999 NEXT JJJJ

This computer program was run with qb64v1000-win [10]. Copied by hand from the screen, the computer program’s only solution through JJJJ=-30407 is shown below:

20126       -284       -201       12       0
-30407

Above there is no rounding by hand; it is just straight copying by hand from the screen.

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [10], the wall-clock time through
JJJJ=-30407 was 20 minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References
[1] R. Burden, J. Faires, A. Burden, Numerical Analysis, Tenth Edition. Cengage Learning, 2016.
[2] R. Burden, J. Faires, Numerical Analysis, Sixth Edition. Brooks/Cole Publishing Company, 1996.
[3] R. Burden, J. Faires, Numerical Analysis, Third Edition. PWS Publishers, 1985.
[4] D. Greenspan, V. Casulli, Numerical Analysis for Applied Mathematics, Science, and Engineering. Addison-Wesley Publishing Company, 1988
[5] L. W. Johnson, R. D. Riess, Numerical Analysis, Second Edition. Addison-Wesley Publishing Company, 1982
[6] Microsoft Corp. BASIC, second edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.
[7] William H. Mills, A System of Quadratic Diophantine Equations, Pacific Journal of Mathematics, 3 (1953), pp. 209-220.
[8] Thomas L. Saaty, Optimization in Integers and Related Extremal Problems. McGraw-Hill, 1970.
[9] Martin Sleziak/Puzzled417, Integer Solutions to Nonlinear System of Equations…. http://www.math.stackexchange.com/questions/2085253/integer-solutions-to-nonlinear-system-of-equations
[10] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64.