Skip to content

calebsakala/libraryofpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฅง Library of Pi

"Everything that can ever be said or written is contained within Pi's infinite digits"

Screenshot 2025-08-24 230511

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.

โœจ Features

  • ๐Ÿ” 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

๐Ÿš€ Live Demo

Visit the live application: Library of Pi

๐Ÿงฎ How It Works

Letter-to-Number Mapping

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

Mathematical Search

  • 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

Probability Calculation

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)

๐Ÿ› ๏ธ Tech Stack

  • 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

๐Ÿ—๏ธ Project Structure

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

๐ŸŽจ Design Philosophy

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

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone the repository

    git clone https://github.com/calebsakala/libraryofpi.git
    cd libraryofpi
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open your browser

    http://localhost:5173
    

Build for Production

npm run build

๐ŸŽญ Features in Detail

๐ŸŒŸ Loading Experience

  • Animated loading screen with progress simulation
  • Cosmic ambiance preparation
  • One-time experience with session persistence

๐Ÿ” Search Interface

  • Real-time input validation
  • Character limit (20 characters)
  • Smooth animations and feedback
  • Mobile-optimized input experience

๐Ÿ“Š Result Display

  • 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

๐ŸŽต Audio Experience

  • Embedded YouTube player with ambient music
  • Subtle positioning and transparency
  • User-controllable playback
  • Auto-play after user interaction

๐Ÿง  The Mathematics

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.

๐Ÿค Contributing

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.

๐Ÿ“ License

This project is open source and available under the MIT License.

๐Ÿ‘จโ€๐Ÿ’ป About the Creator

Caleb Sakala - Inspired by the infinite beauty of mathematics and the wonder of Pi.

Connect with me:


๐ŸŒŸ Star This Repository

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."

About

The world's largest pi string search

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors