High Performance Storage of Prime Numbers

Although modern computers and algorithms can generate very large prime sets in a relatively short time, storing and distributing the resulting data remains a significant practical problem.This paper investigates a storage format that exploits the specific properties of prime numbers. Instead of representing every integer up to a limit, the proposed format allocates one bit only to integers that are coprime to a small primorial. The resulting bitmap can subsequently be further compressed using a general purpose compressor such as gzip.Experiments on a representative interval near 10^13 show that the compressed representation using 23# (primorial of 23) requires approximately 0.46 bytes per prime. At this rate, storing the first 10^12 prime numbers would require less than 450 GiB of storage.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-10-28
DOI
https://doi.org/10.5281/zenodo.23733894
Primary Topic
Algorithms and Data Compression
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

High Performance Storage of Prime Numbers

J. Schwindling
Zenodo (CERN European Organization for Nuclear Research)
Algorithms and Data Compression
article

High Performance Storage of Prime Numbers

J. Schwindling
article en

Abstract

Although modern computers and algorithms can generate very large prime sets in a relatively short time, storing and distributing the resulting data remains a significant practical problem.This paper investigates a storage format that exploits the specific properties of prime numbers. Instead of representing every integer up to a limit, the proposed format allocates one bit only to integers that are coprime to a small primorial. The resulting bitmap can subsequently be further compressed using a general purpose compressor such as gzip.Experiments on a representative interval near 10^13 show that the compressed representation using 23# (primorial of 23) requires approximately 0.46 bytes per prime. At this rate, storing the first 10^12 prime numbers would require less than 450 GiB of storage.

Zenodo (CERN European Organization for Nuclear Research)
Openalex Percentile: Top 14%
Algorithms and Data Compression
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon