# Questions tagged [pi]

This tag is for challenges involving the mathematical constant pi, the ratio of a circle's circumference to its diameter.

60 questions
Filter by
Sorted by
Tagged with
474 views

### Rabinowitz-Wagon $\pi$ formula

In 1995, Stanley Rabinowitz and Stan Wagon found an interesting algorithm to generate the digits of $\pi$ one by one without storing the previous results. The algorithm is called the spigot ...
• 49.2k
6k views

### Print 100 digits of π

Your challenge is to print any 100 consecutive digits of π. You must give the index at which that subsequence appears. The 3 is not included. For example, you could print any of the following: ...
• 40k
3k views

### Calculating π using the Gregory Leibniz series until n terms

based off my previous challenge, this wikipedia article, and a Scratch project Your task: given i, calculate $\pi$ till i ...
• 2,234
3k views

### Calculate Pi unto a point using the Nilakantha series

Your task: given a nonzero positive number i, calculate pi using the Nilakantha series unto i terms. The Nilakantha series is as ...
• 2,234
483 views

### Turing Machine that outputs pi

Turing Machine Preliminaries A Turing machine is specified by the following data A finite set of symbols S = $\{s_1,s_2,...\}$ A finite set of states M = $\{m_1,m_2,...\}$ A partially defined ...
• 201
2k views

### Find a sequence in the binary digits of π

Given a binary sequence of finite length, find the starting position where this sequence first appears in the binary digits of π (after the decimal). You can assume that an answer exists for any input ...
• 1,983
418 views

### Print om sign with pi

This time I will give you an easy challenge: Print the Om sign with $\pi$!(Sorry for many challenges with $\pi$) Here is the om sign drawn using pi numbers: ...
• 9,408
2k views

### Music with pi and e

Because I forgot to celebrate Pi Day (14.3), let's celebrate with $\pi$, $e$ (Euler's number) and music! Challenge No, we don't have time to eat a pi-pizza, let's make a program. What you need is ...
• 9,408
3k views

### Elastic collisions between blocks

The 3Blue1Brown Youtube channel released a video a year ago called "Why do colliding blocks compute pi?" which describes a model where a block A of mass $a$ ...
• 8,689
6k views

• 105k
3k views

### Shorten an already short mathematical expression

For once, I was doing some real work, updating old code, and bumped into an expression that is equivalent to what would be written as πx + ex in good old-fashioned math. I thought it would be possible ...
• 30.8k
4k views

### Map a random number to pi

A double precision representation of a decimal can only guarantee an accuracy of 15 decimal places, thus pi is approximated as: 3.141592653589793 You can see ...
• 46.4k
770 views

### Pi Bowling to 10 in 10 [closed]

Your Goal: Estimate pi to at least 10 decimal places. The format is your choice - it can output as a number, as a string, as an output to STDOUT, etc. Seems easy, right? But wait, it's not as simple ...
• 2,938
1 vote
732 views

### Memory is Expensive [closed]

You are a robot. You are stranded in a small cage with weird humans wearing weird suits looking at you. Your solar panel is malfunctioning, and your energy is running out. On the wall there is a ...
657 views

### Computing truncated digits sums of powers of pi

Given a positive integer n output the sum of the first n decimal digits of the fractional part of πn. Example input and outputs: 1 → 1 2 → 14 3 → ...
• 39.1k
6k views

### Quiche Lorraine [closed]

Since it was Pi day recently, I have noticed a number of challenges that ask you to calculate pi. Of course, a quiche lorraine is not quite a pie (you can claim a Bonus Score¹ of +1 if you guessed ...
• 9,516
3k views

### Calculate π with quadratic convergence

Write a function or complete program that takes a positive number n and performs n steps of an iterative algorithm for ...
1k views

### Transmit Pi... precisely

Following on from Monte Carlo estimator of Pi this challenge is to produce the shortest code for the constant Pi. Except here your code must output consecutive digits of pi forever. This is code ...
4k views

### Monte Carlo estimator of Pi

Happy Pi Day everyone! For no reason at all, I'm trying to construct a Monte Carlo estimator of Pi that is as short as possible. Can we construct one that can fit in a tweet? To clarify, what I have ...
• 397
457 views

### Calculate a pi-based sequence with a pi-based frequence

Introduction Pi is 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089... Let's treat each digit as an instruction as to how to ...
• 10.9k
973 views

### Piem validator programme

Write a program that defines a function that can check if a string variable called "anything you want or inputted by the user" is or not a piem. (piem = a story or poem in which the word lengths ...
• 2,338
772 views

### Pirrational Numbers

Pi is an irrational number, which means that its decimal representation never terminates or repeats itself. Pi truncated to 41 decimal digits (40 places) is ...
• 89.9k
2k views

### 5 Seconds to Find Pie

Pi times e (or Pie if you like ambiguous notation) to 100 decimal places is: ...
• 89.9k
545 views

### When is my piversary?

Since I want to celebrate this definitely not nerdy event, your job is to calculate the piversary (pi-anniversary) of a given date. Input Your code has to have a possibilty to input a date in the ...
• 1,597
1 vote
2k views

### Calculate the most digits of pi [closed]

There are a lot of challenges on this site regarding pi, but none that challenge you to calculate as many digits of pi as possible. As you all may know, pi in its decimal form goes on for infinity, ...
• 1,043
1k views

### PI window encryption

This is a simple encryption method that uses PI digits to encode a message, the method is simple: The key is just a positive integer that indicates where the window starts then: Given a string to ...
• 659