Generating unlimited digits of "pi" is not an easy task.
So I prompted Sonnet 3.7 (on Claude, made by Anthropic) to do it.
And it did! See code below.
This is apparently now called "Vibe coding" :)
decimals = 1000; x = 3 * (10 ** int(decimals + 20)); i = 1; pi = x
while x > 0: x = x * i // ((i + 1) * 4); pi += x // (i + 2); i += 2
print(pi // (10 ** 20))
let decimals = 1, i = 1n, x = 3n * (10n ** BigInt(decimals + 20)), pi = x;
while (x > 0) { x = x * i / ((i + 1n) * 4n); pi += x / (i + 2n); i += 2n; }
console.log(pi / (10n ** 20n));
This is much more compact and faster than AI solution below, and is based on this:
The speed advantage is because BigInt is faster than "decimal".
Vibe coding is an AI-dependent computer programming practice where a person describes a problem in a few sentences as a prompt to a large language model (LLM) tuned for coding. The LLM generates software, freeing the programmer from having to write and debug the underlying code.[1][2][3] Vibe coding is claimed by its advocates to allow even amateur programmers to produce software without the extensive training and skills which coding previously needed.[4] The term was introduced by Andrej Karpathy in February 2025