Table of Contents
Fetching ...

Exact Computation of the Catalan Number $C(2,050,572,903)$

Mahesh Ramani

TL;DR

The paper tackles the challenge of computing exact Catalan numbers at billion-scale by introducing a two-phase method that operates purely in the prime-exponent domain. Phase 1 uses a parallel segmented sieve to obtain $v_p((2n)!)$, $v_p(n!)$, and $v_p(n+1)$, yielding exponents $e_p$ and grouping primes by exponent for storage. Phase 2 reconstructs $C(n)$ from the grouped prime powers via memory-efficient balanced product trees, enabling exact computation on commodity hardware. The work demonstrates the computation of $C(2{,}050{,}572{,}903)$ with $1{,}234{,}567{,}890$ digits and provides reproducible data and code, illustrating a scalable path for factorial-ratio sequences beyond Catalan numbers.

Abstract

This paper presents a two-phase algorithm for computing exact Catalan numbers at an unprecedented scale. The method is demonstrated by computing $C(n)$ for $n = 2,050,572,903$ yielding a result with a targeted $1,234,567,890$ decimal digits. To circumvent the memory limitations associated with evaluating large factorials, the algorithm operates exclusively in the prime-exponent domain. Phase 1 employs a parallel segmented sieve to enumerate primes up to $2n$ and applies Legendre's formula to determine the precise prime factorization of $C(n)$. The primes are grouped by exponent and serialized to disk. Phase 2 reconstructs the final integer using a memory-efficient balanced product tree with chunking. The algorithm runs on a time complexity of $Θ(n(\log n)^2)$ bit-operations and a space complexity of $Θ(n \log n)$ bits. This result represents the largest exact Catalan number computed to date. Performance statistics for a single-machine execution are reported, and verification strategies -- including modular checks and SHA-256 hash validation -- are discussed. The source code and factorization data are provided to ensure reproducibility.

Exact Computation of the Catalan Number $C(2,050,572,903)$

TL;DR

The paper tackles the challenge of computing exact Catalan numbers at billion-scale by introducing a two-phase method that operates purely in the prime-exponent domain. Phase 1 uses a parallel segmented sieve to obtain , , and , yielding exponents and grouping primes by exponent for storage. Phase 2 reconstructs from the grouped prime powers via memory-efficient balanced product trees, enabling exact computation on commodity hardware. The work demonstrates the computation of with digits and provides reproducible data and code, illustrating a scalable path for factorial-ratio sequences beyond Catalan numbers.

Abstract

This paper presents a two-phase algorithm for computing exact Catalan numbers at an unprecedented scale. The method is demonstrated by computing for yielding a result with a targeted decimal digits. To circumvent the memory limitations associated with evaluating large factorials, the algorithm operates exclusively in the prime-exponent domain. Phase 1 employs a parallel segmented sieve to enumerate primes up to and applies Legendre's formula to determine the precise prime factorization of . The primes are grouped by exponent and serialized to disk. Phase 2 reconstructs the final integer using a memory-efficient balanced product tree with chunking. The algorithm runs on a time complexity of bit-operations and a space complexity of bits. This result represents the largest exact Catalan number computed to date. Performance statistics for a single-machine execution are reported, and verification strategies -- including modular checks and SHA-256 hash validation -- are discussed. The source code and factorization data are provided to ensure reproducibility.
Paper Structure (12 sections, 12 equations, 2 tables, 2 algorithms)