For any coprime a + b = c we measure how "extreme" the triple is with its quality: q = log c / log rad(abc). When c barely beats its radical, q sits just below 1. When c is much larger than rad(abc), q climbs above 1 — and the abc conjecture says triples with q above any fixed bound bigger than 1 are finite in number.
<p class="hint">For coprime <b>a + b = c</b>, the <b>radical</b> rad(abc) is the product of the distinct primes dividing a, b and c. The <b>quality</b> is q = log c / log rad(abc). The abc conjecture says q stays just under 1 almost always — triples with high q are rare.</p>
<div class="inputs">
<label>a <input id="a" type="number" min="1" value="5"></label>
<label>b <input id="b" type="number" min="1" value="27"></label>
<button id="go" type="button">Compute</button>
</div>
<div id="out" class="out"></div>
<div class="btns">
<button id="search" type="button">Search high-quality triples</button>
<button id="reset" type="button" class="ghost">Reset</button>
</div>
<div id="board" class="board"></div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .7rem; line-height: 1.45; }
.inputs { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }
label { font: 600 14px system-ui, sans-serif; color: #1d3557; }
input { width: 84px; font: 600 15px ui-monospace, monospace; padding: .35rem .5rem;
border: 1px solid #cdd9e3; border-radius: 8px; margin-left: .25rem; }
.out { background: #e8eef3; border: 1px solid #cdd9e3; border-radius: 8px; padding: .7rem .9rem;
margin: .6rem 0; font: 600 14px ui-monospace, monospace; color: #1d3557; min-height: 1.4em;
line-height: 1.6; }
.out.bad { background: #fdecee; border-color: #f3b6bd; color: #c92f3c; }
.out b { color: #0a7d33; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 .2rem; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
.board { margin-top: .5rem; }
.row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 6px; font: 600 13px ui-monospace, monospace;
padding: .35rem .5rem; border-radius: 6px; }
.row.head { background: #1d3557; color: #fff; }
.row.item { background: #f1f4f7; color: #1d3557; }
.row.item:nth-child(even) { background: #e8eef3; }
.q { font-weight: 700; color: #c92f3c; }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// abc conjecture demo. For coprime a + b = c, rad(abc) is the product of the
// DISTINCT primes dividing a*b*c. The "quality" q = log c / log rad(abc).
// The conjecture: for every eps>0 only finitely many triples have q > 1+eps.
// Computing q for one triple is instant; finding record-high q is the hard search.
function gcd(x, y){ while (y){ [x, y] = [y, x % y]; } return x; }
// distinct prime factors of n (as a Set of primes)
function primeFactors(n){
const s = new Set();
for (let p = 2; p * p <= n; p++){
if (n % p === 0){ s.add(p); while (n % p === 0) n /= p; }
}
if (n > 1) s.add(n);
return s;
}
// rad(abc): product of distinct primes dividing a*b*c
function radical(a, b, c){
const ps = new Set();
[a, b, c].forEach(x => primeFactors(x).forEach(p => ps.add(p)));
let r = 1; ps.forEach(p => r *= p); return r;
}
function quality(a, b){
const c = a + b;
const rad = radical(a, b, c);
const q = Math.log(c) / Math.log(rad);
return { a, b, c, rad, q };
}
function compute(){
const a = Math.max(1, parseInt(document.getElementById('a').value, 10) || 0);
const b = Math.max(1, parseInt(document.getElementById('b').value, 10) || 0);
const out = document.getElementById('out');
if (gcd(a, b) !== 1){
out.className = 'out bad';
out.textContent = fmt('a and b must be coprime (gcd = 1). gcd(%a%,%b%) = %gcd%.', { a: a, b: b, gcd: gcd(a, b) });
return;
}
const t = quality(a, b);
out.className = 'out';
out.innerHTML = a + ' + ' + b + ' = <b>' + t.c + '</b> rad(abc) = ' + t.rad +
' quality q = <b>' + t.q.toFixed(4) + '</b>' +
(t.q > 1 ? ' (q > 1 — a rare, high-quality triple!)' : ' (q < 1 — the typical case)');
}
function search(){
const LIMIT = 200; // search coprime a<b with c=a+b <= LIMIT
const best = [];
for (let a = 1; a < LIMIT; a++){
for (let b = a + 1; a + b <= LIMIT; b++){
if (gcd(a, b) !== 1) continue;
best.push(quality(a, b));
}
}
best.sort((x, y) => y.q - x.q);
const top = best.slice(0, 8);
const board = document.getElementById('board');
let html = '<div class="row head"><span>a + b = c</span><span>rad</span><span>c</span><span>q</span></div>';
top.forEach(t => {
html += '<div class="row item"><span>' + t.a + ' + ' + t.b + ' = ' + t.c +
'</span><span>' + t.rad + '</span><span>' + t.c +
'</span><span class="q">' + t.q.toFixed(4) + '</span></div>';
});
board.innerHTML = html;
console.log(fmt('Top triple under c<=%LIMIT%:', { LIMIT: LIMIT }), top[0]);
}
document.getElementById('go').addEventListener('click', compute);
document.getElementById('search').addEventListener('click', search);
document.getElementById('reset').addEventListener('click', () => {
document.getElementById('a').value = 5;
document.getElementById('b').value = 27;
document.getElementById('board').innerHTML = '';
compute();
});
compute();
<p class="hint">For coprime <b>a + b = c</b>, the <b>radical</b> rad(abc) is the product of the distinct primes dividing a, b and c. The <b>quality</b> is q = log c / log rad(abc). The abc conjecture says q stays just under 1 almost always — triples with high q are rare.</p>
<div class="inputs">
<label>a <input id="a" type="number" min="1" value="5"></label>
<label>b <input id="b" type="number" min="1" value="27"></label>
<button id="go" type="button">Compute</button>
</div>
<div id="out" class="out"></div>
<div class="btns">
<button id="search" type="button">Search high-quality triples</button>
<button id="reset" type="button" class="ghost">Reset</button>
</div>
<div id="board" class="board"></div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .7rem; line-height: 1.45; }
.inputs { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }
label { font: 600 14px system-ui, sans-serif; color: #1d3557; }
input { width: 84px; font: 600 15px ui-monospace, monospace; padding: .35rem .5rem;
border: 1px solid #cdd9e3; border-radius: 8px; margin-left: .25rem; }
.out { background: #e8eef3; border: 1px solid #cdd9e3; border-radius: 8px; padding: .7rem .9rem;
margin: .6rem 0; font: 600 14px ui-monospace, monospace; color: #1d3557; min-height: 1.4em;
line-height: 1.6; }
.out.bad { background: #fdecee; border-color: #f3b6bd; color: #c92f3c; }
.out b { color: #0a7d33; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 .2rem; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
.board { margin-top: .5rem; }
.row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 6px; font: 600 13px ui-monospace, monospace;
padding: .35rem .5rem; border-radius: 6px; }
.row.head { background: #1d3557; color: #fff; }
.row.item { background: #f1f4f7; color: #1d3557; }
.row.item:nth-child(even) { background: #e8eef3; }
.q { font-weight: 700; color: #c92f3c; }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// abc conjecture demo. For coprime a + b = c, rad(abc) is the product of the
// DISTINCT primes dividing a*b*c. The "quality" q = log c / log rad(abc).
// The conjecture: for every eps>0 only finitely many triples have q > 1+eps.
// Computing q for one triple is instant; finding record-high q is the hard search.
function gcd(x, y){ while (y){ [x, y] = [y, x % y]; } return x; }
// distinct prime factors of n (as a Set of primes)
function primeFactors(n){
const s = new Set();
for (let p = 2; p * p <= n; p++){
if (n % p === 0){ s.add(p); while (n % p === 0) n /= p; }
}
if (n > 1) s.add(n);
return s;
}
// rad(abc): product of distinct primes dividing a*b*c
function radical(a, b, c){
const ps = new Set();
[a, b, c].forEach(x => primeFactors(x).forEach(p => ps.add(p)));
let r = 1; ps.forEach(p => r *= p); return r;
}
function quality(a, b){
const c = a + b;
const rad = radical(a, b, c);
const q = Math.log(c) / Math.log(rad);
return { a, b, c, rad, q };
}
function compute(){
const a = Math.max(1, parseInt(document.getElementById('a').value, 10) || 0);
const b = Math.max(1, parseInt(document.getElementById('b').value, 10) || 0);
const out = document.getElementById('out');
if (gcd(a, b) !== 1){
out.className = 'out bad';
out.textContent = fmt('a and b must be coprime (gcd = 1). gcd(%a%,%b%) = %gcd%.', { a: a, b: b, gcd: gcd(a, b) });
return;
}
const t = quality(a, b);
out.className = 'out';
out.innerHTML = a + ' + ' + b + ' = <b>' + t.c + '</b> rad(abc) = ' + t.rad +
' quality q = <b>' + t.q.toFixed(4) + '</b>' +
(t.q > 1 ? ' (q > 1 — a rare, high-quality triple!)' : ' (q < 1 — the typical case)');
}
function search(){
const LIMIT = 200; // search coprime a<b with c=a+b <= LIMIT
const best = [];
for (let a = 1; a < LIMIT; a++){
for (let b = a + 1; a + b <= LIMIT; b++){
if (gcd(a, b) !== 1) continue;
best.push(quality(a, b));
}
}
best.sort((x, y) => y.q - x.q);
const top = best.slice(0, 8);
const board = document.getElementById('board');
let html = '<div class="row head"><span>a + b = c</span><span>rad</span><span>c</span><span>q</span></div>';
top.forEach(t => {
html += '<div class="row item"><span>' + t.a + ' + ' + t.b + ' = ' + t.c +
'</span><span>' + t.rad + '</span><span>' + t.c +
'</span><span class="q">' + t.q.toFixed(4) + '</span></div>';
});
board.innerHTML = html;
console.log(fmt('Top triple under c<=%LIMIT%:', { LIMIT: LIMIT }), top[0]);
}
document.getElementById('go').addEventListener('click', compute);
document.getElementById('search').addEventListener('click', search);
document.getElementById('reset').addEventListener('click', () => {
document.getElementById('a').value = 5;
document.getElementById('b').value = 27;
document.getElementById('board').innerHTML = '';
compute();
});
compute();
Type your own a and b to see c, the radical, and the quality. Then press Search to sweep small coprime pairs and surface the highest-quality triples found — the famous record holder 2 + 310·109 = 235 with q ≈ 1.63 is exceptionally hard to beat. Notice the asymmetry: computing q for one triple is instant, but finding record triples means combing through a vast space, and proving they thin out forever is another matter entirely.
Comments
Loading comments...