The Divide-or-Multiply Sequence: Exact Structure and an Optimal Algorithm

Let a(1)=1 and a(m+1)=a(m)/m if m divides a(m), and a(m+1)=m*a(m) otherwise (OEIS A008336). We prove the product identity a(n) = (n-1)! / product_{m<n, m divides a(m)} m^2, establish an exact recursion on the prime exponents that decides the divisibility condition m divides a(m), and show that the exponent of a prime p > sqrt(n) behaves as a ballot-type walk with fixed parity. The exponent recursion yields the exact prime factorization of a(n) in O(n log log n) arithmetic operations using O(n) memory, completely outperforming the traditional big-integer iteration which requires Omega(n^2 / log n) word operations. Since a(n) >= product_{n/2<p<n} p, the number a(n) has at least (1/(2 ln 2) + o(1)) * n bits. Therefore, any algorithm that outputs a(n) in binary requires Omega(n / log n) steps. This proves that the proposed exponent framework is optimal up to a minor factor of O(log n log log n), and no algorithm can evaluate a(n) in o(n / log n) steps. All theoretical claims are rigorously proved. In C, the compact implementation computes the complete factorization of the monster term a(10^9) in 55.9 seconds using 2 GB of memory. On smaller scales (n=10^5), the exponent framework runs 17 times faster than big-integer iteration in Python and approximately 500 times faster in C.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-09
DOI
https://doi.org/10.5281/zenodo.24085264
Primary Topic
Analytic Number Theory Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

The Divide-or-Multiply Sequence: Exact Structure and an Optimal Algorithm

Mark Kim
Zenodo (CERN European Organization for Nuclear Research)
Analytic Number Theory Research
preprint

The Divide-or-Multiply Sequence: Exact Structure and an Optimal Algorithm

Mark Kim
preprint en

Abstract

Let a(1)=1 and a(m+1)=a(m)/m if m divides a(m), and a(m+1)=m*a(m) otherwise (OEIS A008336). We prove the product identity a(n) = (n-1)! / product_{m<n, m divides a(m)} m^2, establish an exact recursion on the prime exponents that decides the divisibility condition m divides a(m), and show that the exponent of a prime p > sqrt(n) behaves as a ballot-type walk with fixed parity. The exponent recursion yields the exact prime factorization of a(n) in O(n log log n) arithmetic operations using O(n) memory, completely outperforming the traditional big-integer iteration which requires Omega(n^2 / log n) word operations. Since a(n) >= product_{n/2<p<n} p, the number a(n) has at least (1/(2 ln 2) + o(1)) * n bits. Therefore, any algorithm that outputs a(n) in binary requires Omega(n / log n) steps. This proves that the proposed exponent framework is optimal up to a minor factor of O(log n log log n), and no algorithm can evaluate a(n) in o(n / log n) steps. All theoretical claims are rigorously proved. In C, the compact implementation computes the complete factorization of the monster term a(10^9) in 55.9 seconds using 2 GB of memory. On smaller scales (n=10^5), the exponent framework runs 17 times faster than big-integer iteration in Python and approximately 500 times faster in C.

Zenodo (CERN European Organization for Nuclear Research)
Analytic Number Theory Research
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
The Divide-or-Multiply Sequence: Exact Structure and an Optimal Algorithm — Mark Kim · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS