This question already has an answer here:

Inspired by Nicola Sap's Challenge


Your challenge is to simply produce π with 232-1 digits. However today's twist, like the title implies, is to produce it without using any numbers or any π constants in your source-code.


Your program will not be provided usable input. It can output in any reasonable format.


  • Standard Loop-Holes forbidden
  • You cannot use numbers in your source code nor can you use a pi constant if it exists. If your language also has tau defined as 2pi, that's also banned. Numbers are in the range [0-9]
  • You must output as many digits as you can You must output 2^32-1 digits of pi, including the 3. (This has been changed due to the arbitrary nature of the original task)
  • Your Program must terminate, or at least theoretically terminate given enough time. Crashing is an acceptable way to terminate.


This is code golf so shortest answer wins.

A Million Digits of Pi for your use

marked as duplicate by Rushabh Mehta, Post Left Garf Hunter, Jonathan Frech, Stephen Leppik, mbomb007 code-golf Sep 15 at 21:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Just acknowledging that it's been done to death doesn't mean that you're not killing it more. – Jo King Sep 15 at 1:25
  • 2
    How do you define numbers? – Jo King Sep 15 at 1:29
  • @JoKing It might prove to be a fresh enough spin to be interesting. If not, so it goes. Besides, if I didn't say it, someone else would've. Also added – Veskah Sep 15 at 1:31
  • 3
    Given that there are algorithms for computing pi to an arbitrary precision I think there need to be some more limits imposed on the problem. Otherwise the winner is just whoever uses the largest target precision. Working around the no-numbers restriction just requires casting char to int – SamYonnou Sep 15 at 1:32
  • 2
    It's unfortunate that Shakespeare doesn't have arbitrary precision, or else the Shakespeare Programming Language would be a shoo-in. – JosiahRyanW Sep 15 at 3:18

Perl 6, 67 bytes

{$!=.FatRat²/$!+$_+$_-?e}for 𐄳²…¹;say substr ⁴/$!,^²³²

Try it online!

Takes a very long time to compute. As an example here's an altered version that only prints the first 1000 digits.

  • Can you not remove the braces? – H.PWiz Sep 15 at 19:47

Mathematica, 42 39 bytes


Output Returns exactly 4294967295 digits as requested.

If more digits were allowed, then by outputting 7.76e17 digits (if even possible lol), 26 bytes would be possible:


Sorry but Pi = Ln(-1)/i.

  • The OP has changed the challenge to produce 2^32-1 digits of Pi – Jo King Sep 15 at 2:36
  • @JoKing You mean 2147483647 digits exactly? – Shieru Asakoto Sep 15 at 2:38
  • 1
    4,294,967,295 actually. – Veskah Sep 15 at 2:45
  • @Veskah I though it was 2^(32-1)-1 lol – Shieru Asakoto Sep 15 at 2:50

GolfScript, 70 85 bytes

;''!..):t{](..+.*:a@~@*\a(*@)\@}t.+.+t+:T t..*.*t*?(:b?*@;\{.@[\].~/\~%T*@}b*;;]("."@

+15 bytes because I can't read.

Try it online!

Or, actually, don't. Try this online instead, which calculates 4 digits.

Not the answer you're looking for? Browse other questions tagged or ask your own question.