# Questions tagged [pi]

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

59 questions
Filter by
Sorted by
Tagged with
8k views

### Bake a slice of Pi

Write a program or function that prints or outputs this exact text (consisting of 142 characters): ...
• 3,910
9k views

### π Day puzzle for 3/14

Happy π Day. The goal of this question is to calculate the area for a circle of radius 3, where A = πr². The catch is that you have to use the constant π that is defined in a different language than ...
• 3,131
17k views

### Output Pi without math [closed]

In as few bytes as possible, your job is to write a program that outputs: 3.14 In celebration of a late Pi day of course! :) Rules You can do it anyway you ...
• 2,189
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,496
4k views

### Mix pi and e to make pie!

Everybody knows pi the mathematical constant, the ratio of a circle's circumference to its diameter. 3.14159265358979323846264338327950288419716939937510... You ...
• 17.2k
4k views

### Natural Pi #0 - Rock

Goal Create a program/function that takes an input N, check if N random pairs of integers are relatively prime, and returns <...
• 5,726
12k views

### Find the nth decimal of pi

There are already 30 challenges dedicated to pi but not a single one asks you to find the nth decimal, so... Challenge For any integer in the range of ...
6k views

### Calculate 500 digits of pi

Write a program to calculate the first 500 digits of pi, meeting the rules below: It must be less than 500 characters in length. It cannot include "pi", "math.pi" or similar pi constants, nor may it ...
• 3,348
3k views

### Find Primes in Pi

Primes are everywhere... they hide inside Pi 3.1415926535897932384626433832795028841971693993751 Let's get those primes! The Challenge Given as input an integer ...
7k views

Challenge : $\pi$ is supposed to be infinite. That means every number is contained inside the decimal part of $\pi$. Your task will be to take a positive integer on input and return the position ...
• 1,516
9k views

### Pi is still wrong [closed]

Pi is Wrong A common method of computing pi is by throwing "darts" into a 1x1 box and seeing which land in the unit circle compared to the total thrown: ...
• 4,352
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
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.3k
8k views

### Happy Rounded Pi Day

To celebrate Rounded Pi Day, you must take advantage of today's date to make a program that takes in a circle's diameter and outputs its circumference by multiplying the diameter by 3.1416, where 3....
• 519
2k views

### Co-primality and the number pi

Introduction Number theory is full of wonders, in the form of unexpected connections. Here's one of them. Two integers are co-prime if they have no factors in common other than 1. Given a number $N$,...
• 104k
2k views

### Good rational approximations of pi

Write a program that prints out all the good rational approximations of pi with denominator < 1000000, in increasing denominator order. a/b is a "good rational ...
• 20.9k
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,679
2k 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,168
1k views

### A Triangular Slice of Squared Pi

Inspired by Bake a slice of Pi Challenge Given input 3 <= n <= 100 and 3 <= y <= n, construct an ...
• 43.4k
6k views

• 181
7k views

### Print the n-th digit of pi [duplicate]

Task Given an input n, calculate the n-th decimal digit of pi Rules Answer can be a full program or a function. Input must be taken from stdin or from function ...
• 553
456 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