Verifying the absence of triple solutions to a^x +/- b^y = c Nov 3, 2003This program finds all cases (excluding some infinite families) of two solutions to $\pm a^x \pm b^y = c$ that could potentially have a third solution, using the bounds found in Theorems 2 and 3 of the paper "On $\pm a^x \pm b^y = c$ not having three solutions."Note that the notations here do not correspond to those in the paper "On $\pm a^x \pm b^y = c$ not having three solutions." In the finding_i_t procedure: t corresponds to t in Thm 3, and i corresponds to x_2 - x_1 in Thm 3.
In the finding_j_s procedure, the lines temp1=1 and temp2=1 correspond in Thm 3 to b^(T-t) \pm 1 = r = (a^(x_2-x_1) \pm 1)/b^t which is equivalent to b^T = \pm a^{x_1} \pm b^t + a^{x_2}. The j corresponds to x_1, the i corresponds to x_2 - x_1, t corresponds to t, and s corresponds to T-t.
In the finding_n procedure, the several choices of a correspond to k-2 in Lemma 5. Then n+2 corresponds to r+z+j+k in Lemma 5, which gives the upper bound on x_2 in Thm 3. Note that in the procedure finding_j_z, we use N = n+1-i for the upper bound on x_1, and so this means n is an upper bound on x_1 and n+1 is an upper bound on x_2, so n+2 is strictly bigger than x_2, which corresponds to the bound r+z+j+k in Lemma 5.
In the finding_w0 procedure, either w0 = 0 when j=0 in Lemma 3, or the w0 equals the j in Lemma 3 when 2^g = b+1, and the w0 is greater or equal to the j in Lemma 3 if 2^g strictly divides b \pm 1 in any case. (We improved the proofs and changed the notation in the paper after writing the Maple program.)
In the finding_u0_L_z0 procedure, the v0 corresponds to the n0 of Lemma 3, and the capital L corresponds to the small l in the Lemma. The u0 corresponds to the r in Lemma 3. The alpha and beta and z correspond to the alpha_i, beta_i, and z_i in Lemma 3, respectively. The z0 corresponds to the z in Lemma 3.
We have cut and paste the results here: the order is a,b, then the two exponents for a, then the two exponents for b, and finally the c which is preceded by a zero if the lower set of exponents uses the plus sign . Note we have a>2, but if both a and b are odd, our program finds the same result with a and b reversed, so there are 20 results listed, but only 17 distinct pairs of equations, and only 11 distinct sets {a,b,c}. restart;with(numtheory);finding_u0_L_z0 := proc(a,b)
local ord, v0, pmone, u0, L, z0, temp, pset, N, i, j, p, alpha, beta, z;
ord := order(b,a);
v0 := ord;
pmone := -1;
if ord mod 2 = 0 then
if ((b&^(ord/2) mod a) + 1) mod a = 0 then
v0:= ord/2;
pmone := +1;
fi;
fi;
for u0 from 1 while (( b&^v0) mod (a^u0) +pmone) mod (a^u0) = 0
do od;
u0 := u0-1;
L := ((b&^v0) mod (2*a) +pmone) mod(2*a);
pset := factorset( igcd(a,L) );
z0 := 0;
if igcd(a,L) > 1 then
N := nops(pset);
for i from 1 to N do
p := pset[i];
for j from 0 while a mod p^j = 0 do od;
alpha := j-1;
for j from 0 while ((b&^v0 mod p^j) +pmone) mod p^j = 0 do od;
beta := j-1;
z := ceil(beta/alpha);
z0 := max(z,z0);
od;
fi;
[u0, L, z0];
end: finding_w0 := proc(a, b, u0, z0, L)
local w0;
w0 := 0;
if (a-2) mod 4 = 0 and u0 = 1 and L mod 2 <> 0 then
w0 := ceil( log( (b+1)/2^(z0+1))/log(a)) ;
fi;
w0;
end:finding_n := proc(a,b)
local temp, u0, L, z0, w0, n;
temp:= finding_u0_L_z0(a,b);
u0 := temp[1];
L := temp[2];
z0 := temp[3];
w0 := finding_w0(a,b,u0, z0,L);
if a>126 then n := u0+z0+w0; else
if a=3 then n := u0+z0+w0+6; fi;
if a=5 then n := u0+z0+w0+4; fi;
if a=6 or a=7 then n := u0+z0+w0+3; fi;
if 9<a and a<22 then n := u0+z0+w0+2; fi;
if 21<a and a<127 then n := u0+z0+w0+1; fi;
fi;
n;
end:finding_j_s := proc(a,i, pmone, b, t, n)
local j, k, s, r, N, temp1, temp2;
if t>0 then
N := n+1-i;
r := (a^i+pmone)/b^t;
for j from 1 to N do
temp1 := a^j*r + 1;
for k from 0 while temp1 mod b = 0 do temp1 := temp1/b; od;
if temp1 = 1 then
s := k;
if i<>j or s<>t then
if pmone = -1 then
print(a,b,j,i+j,t, s+t, a^j - b^t);
else print(a,b,j,i+j,t, s+t, 0, a^j+b^t);
fi;
fi;
fi;
temp2 := a^j*r - 1;
for k from 0 while temp2 mod b = 0
do temp2 := temp2/b; od;
if temp2 = 1 then
s := k;
if i<>j or s<>t then
if pmone = +1 then
print(a,b,j,i+j,t, s+t, a^j - b^t);
else print(a,b,j,i+j,t, s+t, 0, a^j+b^t);
fi;
fi;
fi;
od;
fi;
end:finding_i_t := proc(a,b,n)
local temp1, temp2, pmone, i, k, t;
for i from 1 to n do
temp1 := a^i+1;
pmone := +1;
for k from 0 while temp1 mod b = 0 do temp1 := temp1/b; od;
t := k;
if t > 0 then finding_j_s(a,i, pmone, b, t, n); fi;
temp2 := a^i-1;
pmone := -1;
for k from 0 while temp2 mod b = 0 do temp2 := temp2/b; od;
t := k;
if t > 0 then finding_j_s(a,i, pmone, b, t, n); fi;
od;
end:mainbody:= proc(a,b)
local n;
if igcd(a,b) = 1 then
if iperfpow(a) = FAIL then
if iperfpow(b) = FAIL then
n := finding_n(a,b);
finding_i_t(a,b,n);
fi;
fi;
fi;
end: Begin actual computations. for a from 3 to 24332 do
for b from 2 to 24332 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a); fi;
od;a;b;Checking b=2 onlyfor a from 3 to 24333 do
for b from 2 to 2 do
mainbody(a,b);
od;
if a mod 2000 = 0 then print(a); fi;
od;We reworked our proof to allow us to sieve only half as many cases, i.e., only those with b > a. We will begin at a=400, since we have done farther than this bound already. Note that the memory allocation of Maple is not optimal for numerical calculations, so the time it takes for a series of runs depends on how many previous runs one has done. We will show the time on some runs to illustrate this dependency on the length of a previous run. Breaks in the calculation indicate that we closed Maple and restarted it to clear the memory allocations. So our new module:tim:= time():
for a from 400 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 1231 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 1544 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 1875 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 2195 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 2937 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;for a from 3060 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 3699 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 4253 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;tim:= time():
for a from 4619 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;for a from 5040 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 5431 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 5867 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 6265 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 7183 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 7604 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;for a from 8035 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a); fi;
od;a;b;tim:= time():
for a from 8533 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 9614 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 10084 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 10565 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 11067 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 12297 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 12929 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 13644 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 20 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 14204 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 14976 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 17065 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 19699 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;tim:= time():
for a from 21703 to 24332 do
for b from a+1 to 24333 do
mainbody(a,b);
od;
if a mod 100 = 0 then print(a, time() - tim); tim := time(); fi;
od;a;b;