Questions tagged [pi]
This tag is for challenges involving the mathematical constant pi, the ratio of a circle's circumference to its diameter.
61
questions
18
votes
11
answers
2k
views
Count squares in my pi approximation
One way to approximate π is the following: Start by drawing a 2x2 square with a quarter-circle in it. Then, the area of the quarter-circle is π.
We can approximate this area by filling it with ...
14
votes
16
answers
594
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 ...
13
votes
11
answers
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:
...
17
votes
37
answers
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 ...
21
votes
17
answers
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 ...
10
votes
1
answer
503
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 ...
18
votes
5
answers
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 ...
-4
votes
7
answers
422
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
votes
8
answers
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 ...
22
votes
14
answers
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\$ ...
20
votes
22
answers
6k
views
Pi to the power y, for small y's
Input
This task takes no input.
Output
Your code should compute and print (or return)
\$\pi^y\$ for all \$y = \frac11, \frac12, \frac13, \frac14, \frac15, \frac16, \frac17, \frac18, \frac19, \frac1{...
-4
votes
6
answers
2k
views
Output first \$n\$ digits of \$\pi^{1/\pi}\$
This challenge is to produce the shortest code for the constant \$\pi^{1/\pi}\$. Your code must output the first \$n\$ consecutive digits of \$\pi^{1/\pi}\$, where \$n\$ is given in the input. ...
9
votes
9
answers
713
views
Pi Day: Determine if a list of words is correct Pilish
Background
Though this is a bit late for Pi Day, I saw an article about Pilish and thought it would make a great challenge. Pilish is created by using a sequence of words where each word's length ...
-4
votes
3
answers
426
views
Without using numbers, Calculate Pi [duplicate]
Inspired by Nicola Sap's Challenge
Goal
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 π ...
-3
votes
7
answers
845
views
Calculate the sum of all odd digits of pi in range [duplicate]
Introduction
In the not so distant future with the AI revolution, we will need a way to solve their captchas to prove we're not humans.
This challenge was inspired by CommitStrip.
Challenge
One ...