"Everything that can ever be said or written is contained within Pi's infinite digits"
A mystical, interactive web application that searches for words and phrases hidden within the infinite digits of Pi. Built with React, TypeScript, and mathematical wonder.
- ๐ Word Search: Search for any (20 character) word or phrase within the first billion digits of Pi
- ๐ญ Beautiful Visualization: Animated spirograph patterns based on Pi's mathematical properties
- ๐ Probability Analysis: Advanced mathematical calculations showing the likelihood of finding patterns
- ๐ต Ambient Experience: Subtle background music to enhance the cosmic exploration
- ๐ฑ Responsive Design: Works seamlessly on desktop and mobile devices
- ๐ Cosmic Theme: Mystical dark theme with golden accents and floating animations
Visit the live application: Library of Pi
Words are converted to numbers using a custom mapping table with 100 unique characters (including Latin, Turkish, accented, and select Greek letters):
- Each character is assigned a two-digit code from 00 to 99
- For example: A=00, ร=01, ร=12, ฤฐ=34, ร=58, ล=72, ฮจ=99
- "รAฤRI" becomes "1204311734"
- This numeric sequence is then searched within Pi's digits
- Searches through over 10 billion digits of Pi using the pilookup.com API and a Go API hosted on AWS EC2.
- Displays the exact position where your phrase appears
- Shows surrounding context with both numeric and letter representations
When a sequence isn't found, we calculate the probability using:
- Finite State Automata to track partial pattern matches
- Markov Chain Analysis for modeling the search process
- Matrix Exponentiation for efficient probability calculations
- Assumes Pi's digits are statistically random (which they appear to be)
- Frontend: React 18 + TypeScript
- Styling: Custom CSS with Tailwind CSS utilities
- Animations: GSAP (GreenSock)
- UI Components: Custom components with shadcn/ui base
- Build Tool: Vite
- API: pilookup.com for Pi digit searches
src/
โโโ components/
โ โโโ ui/ # Base UI components
โ โโโ PiVisualization/ # Mathematical visualization component
โโโ App.tsx # Main application component
โโโ App.css # Cosmic styling and animations
โโโ main.tsx # Application entry point
The Library of Pi embraces a cosmic, mystical aesthetic that reflects the infinite nature of Pi:
- Dark cosmic background with subtle gradients
- Golden color palette (rgba(205, 193, 147)) for mathematical elegance
- Floating animations and particle effects
- Typography: Playfair Display for headings, Crimson Text for body
- Smooth transitions and micro-interactions throughout
- Node.js 18+
- npm or yarn
-
Clone the repository
git clone https://github.com/calebsakala/libraryofpi.git cd libraryofpi -
Install dependencies
npm install
-
Start development server
npm run dev
-
Open your browser
http://localhost:5173
npm run build- Animated loading screen with progress simulation
- Cosmic ambiance preparation
- One-time experience with session persistence
- Real-time input validation
- Character limit (20 characters)
- Smooth animations and feedback
- Mobile-optimized input experience
- Success: Beautiful card showing discovery details, position, and context
- Not Found: Probability analysis with mathematical explanation
- Context Visualization: Shows before/after sequences in both numbers and letters
- Embedded YouTube player with ambient music
- Subtle positioning and transparency
- User-controllable playback
- Auto-play after user interaction
Pi contains every possible finite sequence of digits, which means:
- Every book ever written exists somewhere in Pi
- Every conversation, including this README
- Every possible combination of letters and numbers
- The challenge is finding them within computational limits
Our search covers the first 10 billion digits, giving us a substantial window into Pi's infinite sequence.
Contributions are welcome! Whether you want to:
- Improve the mathematical algorithms
- Enhance the visual design
- Add new features
- Fix bugs
- Improve documentation
Please feel free to open issues and pull requests.
This project is open source and available under the MIT License.
Caleb Sakala - Inspired by the infinite beauty of mathematics and the wonder of Pi.
- ๐ผ LinkedIn: linkedin.com/in/calebsakala
- ๐ฆ Twitter/X: @bytecaleb
- ๐ป GitHub: @calebsakala
If you find this project interesting or useful, please consider giving it a star! It helps others discover the infinite beauty of Pi.
"In the digits of Pi, every story has already been written, every equation already solved, every dream already dreamed. We're just archaeologists of the infinite, uncovering what was always there."