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.


翻译:本文提出了一种两阶段算法,用于以前所未有的规模精确计算卡特兰数。该方法通过计算 $n = 2,050,572,903$ 时的 $C(n)$ 得以验证,所得结果具有目标值 $1,234,567,890$ 位十进制数字。为规避计算大阶乘时伴随的内存限制,该算法完全在素数指数域内运行。第一阶段采用并行分段筛法枚举所有不超过 $2n$ 的素数,并应用勒让德公式确定 $C(n)$ 的精确素数分解。素数按其指数分组并序列化存储至磁盘。第二阶段使用一种具有分块功能的内存高效平衡乘积树来重构最终整数。该算法的时间复杂度为 $Θ(n(\log n)^2)$ 比特操作,空间复杂度为 $Θ(n \log n)$ 比特。此结果代表了迄今为止计算出的最大精确卡特兰数。文中报告了单机执行的性能统计数据,并讨论了验证策略——包括模校验和 SHA-256 哈希验证。提供了源代码和分解数据以确保可复现性。

0
下载
关闭预览

相关内容

【中科大】数值计算方法扩充课程,116页pdf
专知会员服务
84+阅读 · 2022年1月7日
伊利诺伊《算法》书籍,集20年之大成,附472页pdf
专知会员服务
65+阅读 · 2020年9月27日
【经典书】算法C语言实现,Algorithms in C. 672页pdf
专知会员服务
82+阅读 · 2020年8月13日
【干货书】数值计算C编程,319页pdf,Numerical C
专知会员服务
72+阅读 · 2020年4月7日
今日头条广告算法面经!
算法与数据结构
25+阅读 · 2019年5月29日
入门 | 一文介绍机器学习中基本的数学符号
机器之心
28+阅读 · 2018年4月9日
各厂推荐算法!
程序猿
17+阅读 · 2018年1月13日
用于数学的 10 个优秀编程语言
算法与数据结构
13+阅读 · 2018年1月5日
干货|掌握机器学习数学基础之优化[1](重点知识)
机器学习研究会
10+阅读 · 2017年11月19日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月1日
VIP会员
相关资讯
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员