DEFDBL A-Z
OPEN "strange equation.txt" FOR OUTPUT AS #2
FOR tot = 1 TO 6000
IF tot MOD 100 = 0 THEN PRINT tot;
FOR c = 1 TO tot - 2
IF INKEY$ = CHR$(27) THEN GOTO endit
t = tot - c
FOR a = 1 TO t / 2
b = t - a
v = gcd(a * a, b * b) + gcd(a, b * c) + gcd(b, a * c) + gcd(c, a * b)
IF v = 199 THEN PRINT: PRINT a, b, c: PRINT #2,: PRINT #2, a, b, c
NEXT
NEXT
NEXT
endit:
CLOSE
END
FUNCTION gcd (x, y)
dnd = x: dvr = y
IF dnd < dvr THEN SWAP dnd, dvr
DO
q = INT(dnd / dvr)
r = dnd - q * dvr
dnd = dvr: dvr = r
LOOP UNTIL r = 0
gcd = dnd
END FUNCTION
finds no solutions up to all combinations of a, b and c adding to any positive integer up to 6000.
Also,
10 for Tot=1 to 6000
20 if Tot @ 100=0 then print Tot;
30 for C=1 to Tot-2
40 if inkey=chr(27) then cancel for:cancel for:goto *Endit
50 T=Tot-C
60 for A=1 to int(T/2)
70 B=T-A
80 V=gcd(A*A,B*B)+gcd(A,B*C)+gcd(B,A*C)+gcd(C,A*B)
90 if Prmdiv(V)=V then print V;
100 next
110 next
120 next
130 *Endit
140 close 1
150 end
when run through a total of 500, comes up with various values, none being 199, but also not any prime number, of which 199 is one. A page worth of the odd values taken on (there were even ones, but they are not printed) are:
49 289 1369 49 2401 361 169 289 49 5329 121 841 143 143 899
5041 49 91 49 49 49 49 91 2209 49 91 49 49 49 169 539 169
49 169 49 169 49 169 4499 121 121 121 121 121 121 289 323
77 49 361 49 77 437 1849 49 361 77 49 121 169 161 961 169
1681 133 121 49 3721 3481 49 49 49 49 49 49 49 49 49 289
841 289 289 121 143 539 143 187 143 49 169 361 169 49 1369
49 169 2809 49 49 49 49 49 49 49 49 121 121 77 247 49 77
221 91 2401 2209 49 121 49 361 121 49 961 361 121 49 539
49 169 49 169 841 49 169 1849 121 289 143 323 1681 49 49
49 49 49 49 49 169 361 49 1369 121 121 121 77 77 49 49
539 49 77 289 49 121 169 49 169 961 841 49 91 361 49 121
143 49 169 289 49 539 49 49 49 121 77 169 361 289 49 121
49 49 169 121 49 49 49 49 361 49 49 361 49 49 361 49 49
361 49 49 361 49 49 361 49 361 49 49 361 49 49 361 49 143
143 121 143 143 121 143 143 49 169 289 49 847 49 289 169
2107 2401 49 169 289 49 49 289 7231 49 2401 49 169 49 289
169 49 2401 49 169 289 49 28567 27889 49 121 49 133 121 529
49 961 49 121 49 49 121 49 961 4489 253 49 133 121 49 529
961 133 121 49 49 49 961 49 253 4489 49 121 49 961 529 133
121 49 143 143 143 49 169 361 169 49 1369 49 169 169 49
1369 49 169 361 403 49 11881 169 361 169 49 1369 49 169 26569
2303 2209 2303 121 289 121 1681 289 121 121 121 289 1681 121
289 121 25921 49 49 217 49 77 49 49 77 49 77 49 49 77 49
77 49 49 11449 77 49 77 49 49 77 49 217 49 49 169 49 49
169 49 2809 49 169 49 6241 169 49 49 169 49 259 169 49 49
24649 143 121 143 143 121 143 143 121 143 143 143 121 143
529 847 529 847 24031 49 49 361 49 49 361 49 49 361 49 49
361 49 301 361 49 10609 361 49 49 361 49 49 361 49 323 289
323 119 323 6083 289 551 323 289 323 49 121 169 49 169 961
169 343 169 49 3721 49 121 169 49 169 961 169 10201 49 169
121 49 3721 49 121 169 49 169 22801 77 77 77 77 22201 49
49 49 49 49 49 1897 49 49 49 49 49 49 1897 49 49 49 49
49 49 1897 49 49 49 121 121 121 121 121 3481 121 121 121
121 121 121 3481 121 121 121 49 169 289 437 77 1369 49 2597
361 221 119 5329 77 169 247 667 9409 49 1517 49 361 299 77
529 529 20449 49 49 49 49 49 49 49 49 49 49 49 49 49 49
49 49 49 49 49 49 49 49 49 209 1127 143 1763 121 5201 1681
209 121 1763 143 49 169 49 169 49 169 49 2209 169 49 169
49 169 49 169 49 169 49 169 49 169 49 169 19321 289 289
289 289 289 289 289 289 18769 49 121 49 361 121 49 961 361
121 49 49 121 961 49 121 361 49 121 49 8281 49 121 49 121
49 961 361 121 49 203 49 169 49 529 49 169 49 49 169 4489
49 169 7921 49 49 169 529 49 49 17689 121 121 121 2809 121
121 2809 121 17161 49 49 77 133 49 77 49 49 77 161 77 49
133 49 77 49 77 49 161 77 49 77 49 323 407 323 289 323
49 169 589 169 847 49 1369 169 361 169 49 1369 133 7231 361
49 1369 847 49 169 143 121 143 143 143 143 121 143 121 143
49 49 49 49 49 49 49 49 49 49 49 49 49 6889 49 49 49 49
There are quite a few squares of primes though.
|
Posted by Charlie
on 2013-03-16 08:08:55 |