About the Programs
Throughout the free stuff section you will see topics with (C++). These topics include a code block that you can run locally on your terminal. They would all run equally well in Python, but as you get to very large numbers (and you might if you're interested), there is no competition - you need C++.
All the programs were tested on a 2019 MacBook (2.3 GHz 8-Core Intel Core i9; 16 GB 2667 MHz DDR4). They all run fine on any modern computer.
macOS Setup
# Install Xcode Command Line Tools (includes g++)
xcode-select --install
# Verify installation
g++ --version
# Optional: Install GMP for large number support
brew install gmp
Windows Setup
# Download and install MSYS2 from https://www.msys2.org/
# After installation, open MSYS2 terminal and run:
pacman -Syu
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-gmp
# Add to PATH: C:\msys64\mingw64\bin
Linux Setup
# Install build essentials
sudo apt install build-essential
# Install GMP for large number support
sudo apt install libgmp-dev
# Install development tools
sudo dnf groupinstall "Development Tools"
# Install GMP
sudo dnf install gmp-devel
# Install base development
sudo pacman -S base-devel
# Install GMP
sudo pacman -S gmp
Compiling Programs
# Basic compilation
g++ -o program program.cpp
# With optimizations (recommended for large computations)
g++ -O2 -o program program.cpp
# With GMP library (for programs using large integers)
g++ -o program program.cpp -lgmp -lgmpxx
# With debug symbols
g++ -g -o program program.cpp
Programs on This Site
Riemann Zeta Function
Compute the zeta function on the critical line.
Chebyshev's Bias
Compute the prime distribution bias mod 4.
Twin Prime Constant
Calculate the twin prime constant C2.
Lucas-Lehmer Test
Test Mersenne primes (requires GMP).
Hardy-Littlewood
Explore twin prime spacings.
Last Digits of Primes
Discover the surprising digit bias.
Buckets (Heat Map)
Visualize prime distribution (requires SDL2).
Ulam Spirals
Generate Ulam spiral visualizations (requires SDL2).