goodstein sequences

start with any number. write it in hereditary base 2. bump the base, subtract 1. repeat. the number explodes to absurd size, then — always — comes back to 0. provable only with transfinite ordinals.

big integers via BigInt, so early terms are exact. after a while the numbers have thousands of digits — that's the point. 4 is the classic: it reaches ~3·2402653211 before finally hitting 0. no shortcut exists; the descent is real but unprovably long in peano arithmetic.