GIMPS (Great Internet Mersenne Prime Search) implementation in Go.
This project is an implementation of Mersenne prime search algorithms in Go. The project includes:
- Lucas-Lehmer test for checking Mersenne number primality
- PRP (Probable Prime) tests
- Factoring algorithms: Trial Factoring, P-1, P+1, ECM
- PrimeNet server integration
- Multi-threaded work unit processing
- State saving and restoration
gimps-go/
├── cmd/gimps/ # Main executable
├── internal/
│ ├── algorithms/ # Testing and factoring algorithms
│ ├── primenet/ # PrimeNet integration
│ ├── worker/ # Worker management
│ ├── storage/ # State persistence
│ └── math/ # Mathematical utilities
└── pkg/config/ # Configuration
go build ./cmd/gimps# Start workers
./gimps
# Configuration menu
./gimps -m
# Show status
./gimps -s
# Contact PrimeNet server
./gimps -c
# Torture test
./gimps -t
# Version
./gimps -vConfiguration is stored in prime.ini file. Main parameters:
UsePrimenet- use PrimeNet (0/1)UserID- user IDComputerName- computer nameWorkers- number of workersWorkPreference- work type preferencesDayMemory/NightMemory- memory in MB
Primality test for Mersenne numbers (2^p - 1). Algorithm: s_0 = 4, s_i = (s_{i-1}^2 - 2) mod (2^p - 1).
Probable Prime test: computes base^(N-1) mod N.
Search for small divisors of Mersenne numbers. Uses the property: divisors have the form 2kp+1.
Pollard P-1 factoring method with two stages.
Similar to P-1, but uses P+1 group.
Elliptic Curve Method for factoring.
The project supports integration with PrimeNet server for receiving assignments and submitting results.
This project is based on the original Prime95 source code from Mersenne Research, Inc.