Here is a genuine olympiad-flavored claim: for every positive integer n, the number n3−n is always divisible by 6. Pick any whole number, and the demo will verify the claim by brute force — then walk through the actual proof one step at a time, exactly the way a grader (human or AI) has to check it.
<p class="hint">Claim: for every positive integer <code>n</code>, the number <code>n³ − n</code> is always divisible by 6. Pick an <code>n</code>, then either check it by brute force or walk through the real proof.</p>
<div class="row">
<label for="n-input">n =</label>
<input id="n-input" type="number" min="1" max="999" value="7" />
<button id="brute" type="button">Verify by brute force</button>
<button id="walk" type="button">Walk the proof</button>
<button id="reset" type="button" class="ghost">Reset</button>
</div>
<div class="status" id="status">Choose a number and pick a button.</div>
<ol id="steps" class="steps"></ol>
* { 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; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
label { font-size: .85rem; font-weight: 600; color: #1d3557; }
input[type="number"] { width: 5.5rem; padding: .35rem .5rem; border: 1px solid #adb1b8;
border-radius: 6px; font: 600 15px ui-monospace, monospace; }
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; }
.status { font-size: 1rem; font-weight: 600; margin: .3rem 0 .6rem; min-height: 1.4em; }
.status.ok { color: #0a7d33; }
.status.bad { color: #c92f3c; }
.steps { margin: 0; padding-left: 1.2rem; font-size: .92rem; line-height: 1.55; }
.steps li { margin-bottom: .4rem; }
.steps li.reveal { animation: fade .25s ease-in; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
code { background: #e8eef3; padding: .05rem .35rem; border-radius: 4px; font: 600 .92em ui-monospace, monospace; }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// Claim: n^3 - n is divisible by 6 for every positive integer n.
const input = document.getElementById('n-input');
const statusEl = document.getElementById('status');
const stepsEl = document.getElementById('steps');
function setStatus(t, cls) { statusEl.textContent = t; statusEl.className = 'status ' + cls; }
function clearSteps() { stepsEl.innerHTML = ''; }
function addStep(html) {
const li = document.createElement('li');
li.className = 'reveal';
li.innerHTML = html;
stepsEl.appendChild(li);
}
function getN() {
const n = parseInt(input.value, 10);
return Number.isFinite(n) && n >= 1 ? n : 1;
}
// Brute-force mode: just compute n^3 - n and test divisibility for the chosen n.
function bruteForce() {
clearSteps();
const n = getN();
const value = n * n * n - n;
const divisible = value % 6 === 0;
addStep(fmt('Compute: %n%<sup>3</sup> − %n% = <b>%value%</b>.', { n: n, value: value }));
addStep(fmt(divisible ? '%value% ÷ 6 has no remainder. ✓ True for this n — but a single example never proves the claim for every n.' : '%value% is not a multiple of 6 — check your input.', { value: value }));
if (divisible) setStatus(fmt('n³ − n is divisible by 6 for n = %n% — but that’s just one data point.', { n: n }), 'ok');
else setStatus('Something’s off — recheck the arithmetic.', 'bad');
}
// Proof mode: factor the expression and argue divisibility by 2 and by 3 in general, for any n.
function walkProof() {
clearSteps();
const n = getN();
const a = n - 1, b = n, c = n + 1;
addStep(fmt('Factor: n<sup>3</sup> − n = n(n<sup>2</sup> − 1) = n(n − 1)(n + 1). For n = %n%, that’s the product of three consecutive integers.', { n: n }));
addStep(fmt('So the three consecutive integers are (%a%)(%b%)(%c%) — always of the form (n − 1)·n·(n + 1), whatever n is.', { a: a, b: b, c: c }));
addStep('Among any two consecutive integers, one is even. So among (n − 1), n, (n + 1), at least one is a multiple of 2.');
addStep('Among any three consecutive integers, exactly one is a multiple of 3. So one of (n − 1), n, (n + 1) is divisible by 3.');
addStep('2 and 3 share no common factor, so having a factor of 2 and a factor of 3 among the same three numbers means the whole product is divisible by 2 × 3 = 6.');
addStep(fmt('Conclusion: n(n − 1)(n + 1) is divisible by 6 for <b>every</b> positive integer n — not just n = %n%. That’s a proof, not a sample.', { n: n }));
setStatus('Proved for every n, not just the one you tried.', 'ok');
}
document.getElementById('brute').addEventListener('click', bruteForce);
document.getElementById('walk').addEventListener('click', walkProof);
document.getElementById('reset').addEventListener('click', () => {
clearSteps();
setStatus('Choose a number and pick a button.', '');
});
<p class="hint">Claim: for every positive integer <code>n</code>, the number <code>n³ − n</code> is always divisible by 6. Pick an <code>n</code>, then either check it by brute force or walk through the real proof.</p>
<div class="row">
<label for="n-input">n =</label>
<input id="n-input" type="number" min="1" max="999" value="7" />
<button id="brute" type="button">Verify by brute force</button>
<button id="walk" type="button">Walk the proof</button>
<button id="reset" type="button" class="ghost">Reset</button>
</div>
<div class="status" id="status">Choose a number and pick a button.</div>
<ol id="steps" class="steps"></ol>
* { 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; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
label { font-size: .85rem; font-weight: 600; color: #1d3557; }
input[type="number"] { width: 5.5rem; padding: .35rem .5rem; border: 1px solid #adb1b8;
border-radius: 6px; font: 600 15px ui-monospace, monospace; }
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; }
.status { font-size: 1rem; font-weight: 600; margin: .3rem 0 .6rem; min-height: 1.4em; }
.status.ok { color: #0a7d33; }
.status.bad { color: #c92f3c; }
.steps { margin: 0; padding-left: 1.2rem; font-size: .92rem; line-height: 1.55; }
.steps li { margin-bottom: .4rem; }
.steps li.reveal { animation: fade .25s ease-in; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
code { background: #e8eef3; padding: .05rem .35rem; border-radius: 4px; font: 600 .92em ui-monospace, monospace; }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// Claim: n^3 - n is divisible by 6 for every positive integer n.
const input = document.getElementById('n-input');
const statusEl = document.getElementById('status');
const stepsEl = document.getElementById('steps');
function setStatus(t, cls) { statusEl.textContent = t; statusEl.className = 'status ' + cls; }
function clearSteps() { stepsEl.innerHTML = ''; }
function addStep(html) {
const li = document.createElement('li');
li.className = 'reveal';
li.innerHTML = html;
stepsEl.appendChild(li);
}
function getN() {
const n = parseInt(input.value, 10);
return Number.isFinite(n) && n >= 1 ? n : 1;
}
// Brute-force mode: just compute n^3 - n and test divisibility for the chosen n.
function bruteForce() {
clearSteps();
const n = getN();
const value = n * n * n - n;
const divisible = value % 6 === 0;
addStep(fmt('Compute: %n%<sup>3</sup> − %n% = <b>%value%</b>.', { n: n, value: value }));
addStep(fmt(divisible ? '%value% ÷ 6 has no remainder. ✓ True for this n — but a single example never proves the claim for every n.' : '%value% is not a multiple of 6 — check your input.', { value: value }));
if (divisible) setStatus(fmt('n³ − n is divisible by 6 for n = %n% — but that’s just one data point.', { n: n }), 'ok');
else setStatus('Something’s off — recheck the arithmetic.', 'bad');
}
// Proof mode: factor the expression and argue divisibility by 2 and by 3 in general, for any n.
function walkProof() {
clearSteps();
const n = getN();
const a = n - 1, b = n, c = n + 1;
addStep(fmt('Factor: n<sup>3</sup> − n = n(n<sup>2</sup> − 1) = n(n − 1)(n + 1). For n = %n%, that’s the product of three consecutive integers.', { n: n }));
addStep(fmt('So the three consecutive integers are (%a%)(%b%)(%c%) — always of the form (n − 1)·n·(n + 1), whatever n is.', { a: a, b: b, c: c }));
addStep('Among any two consecutive integers, one is even. So among (n − 1), n, (n + 1), at least one is a multiple of 2.');
addStep('Among any three consecutive integers, exactly one is a multiple of 3. So one of (n − 1), n, (n + 1) is divisible by 3.');
addStep('2 and 3 share no common factor, so having a factor of 2 and a factor of 3 among the same three numbers means the whole product is divisible by 2 × 3 = 6.');
addStep(fmt('Conclusion: n(n − 1)(n + 1) is divisible by 6 for <b>every</b> positive integer n — not just n = %n%. That’s a proof, not a sample.', { n: n }));
setStatus('Proved for every n, not just the one you tried.', 'ok');
}
document.getElementById('brute').addEventListener('click', bruteForce);
document.getElementById('walk').addEventListener('click', walkProof);
document.getElementById('reset').addEventListener('click', () => {
clearSteps();
setStatus('Choose a number and pick a button.', '');
});
Notice what each button does. Verify by brute force just computes n3−n and divides — that's the "guess-and-check" a language model does when it pattern-matches the right final number without reasoning about why. Walk the proof instead builds the argument step by step: factor n3−n, show why one of three consecutive integers is a stepping stone to divisibility by both 2 and 3, and only then declare the claim proven for all n, not just the one you tried. Getting the number right is easy. Justifying every step is the actual olympiad.
Comments
Loading comments...