---
title: 'Kurepa Factorial: Conjectures & Computations'
url: https://www.emergentmind.com/topics/kurepa-factorial
type: topic
---

# Kurepa Factorial: Conjectures & Computations

The **Kurepa factorial**, also called the **left factorial**, is the arithmetic function
\[
!n:=\sum_{k=0}^{n-1}k!,
\]
with \( !0=0 \). Its central conjectural property, usually called **Kurepa’s hypothesis** or **Kurepa’s conjecture**, asserts that for every integer \(n\ge 2\),
\[
\gcd(!n,n!)=2.
\]
Equivalently, for every odd prime \(p\), one has \(p\nmid !p\). The topic lies at the intersection of elementary number theory, modular arithmetic, combinatorial sequences, and large-scale computation, and it has generated reformulations in terms of determinants, derangement numbers, and Bell numbers, as well as algorithmic work extending direct verification to all odd primes \(p<2^{40}\) without a counterexample [1312.7037] [1409.0800] [1904.09196].

## 1. Definitions and equivalent formulations

Kurepa’s hypothesis is stated in several equivalent forms in the literature. In its original arithmetical form, it says that for every integer \(n\ge 2\),
\[
\gcd(!n,n!)=2.
\]
For odd primes \(p\), this is equivalent to the congruence condition
\[
!p\not\equiv 0 \pmod p.
\]
Another formulation, attributed to R. Guy, is
\[
!n\not\equiv 0 \pmod n \qquad \forall n>2.
\]
These equivalences are explicit in the work on variations of the hypothesis [1312.7037].

The function itself is classical enough to have a standard sequence entry: it is Sloane’s OEIS sequence A003422 [1312.7037]. The arithmetic content of the conjecture is that the only unavoidable common factor of \( !n \) and \( n! \) is \(2\), so every odd prime divisor of \(n!\) should fail to divide \( !n \).

Historically, the computational status recorded in 2013 was that the hypothesis had been verified by computer up to \(n<1{,}000{,}000\), while remaining open in general and with “no significant theoretical progress since 1971” according to that source [1312.7037]. Later computational work greatly extended this range.

## 2. Reformulations via determinants, derangements, and Bell numbers

A substantial line of work reformulates the divisibility question in terms of other combinatorial and algebraic objects. One such reformulation uses **Kurepa’s determinant** \(K_n\), defined for \(n\ge 7\) as the determinant of a specific \((n-4)\times (n-4)\) matrix. For odd primes \(p\ge 7\), the statement
\[
K_p\not\equiv 0 \pmod p
\]
is equivalent to Kurepa’s hypothesis for \(p\) [1312.7037]. For \(p>5\), the determinant also satisfies the congruence
\[
K_p=\frac{1}{8}\sum_{k=0}^{p-1}\frac{(-1)^k}{k!}\pmod p,
\]
which ties the determinant to exponential-type truncated sums and, through them, to derangement numbers [1312.7037].

The relevant derangement sequence is
\[
S_n=n!\sum_{k=0}^{n}\frac{(-1)^k}{k!}.
\]
For primes \(p\), the congruence
\[
!p\equiv S_{p-1}\pmod p
\]
holds, and the hypothesis is equivalent to the nonvanishing congruence \(S_{p-1}\not\equiv 0\pmod p\) for all odd primes \(p\). The same paper gives a broader equivalence: for all \(n\ge 3\), Kurepa’s hypothesis is equivalent to
\[
S_{n-1}\not\equiv 0\pmod n,
\]
and also equivalent to the statement that the numerator of
\[
\sum_{k=0}^{n-1}\frac{(-1)^k}{k!}
\]
is not divisible by \(n\) [1312.7037].

Bell numbers supply a further reformulation. For any prime \(p\),
\[
B_{p-1}-1\equiv S_{p-1}\pmod p,
\]
so Kurepa’s hypothesis is equivalent to
\[
B_{p-1}\not\equiv 1\pmod p \qquad \forall p\ge 3.
\]
This places the left factorial problem in direct contact with set partition counts and with congruence phenomena for classical combinatorial sequences [1312.7037].

The determinant framework also generated a stronger conjectural extension, the **strong Kurepa hypothesis**, formulated as
\[
K_n\not\equiv 0\pmod n \qquad \forall n>7.
\]
That stronger statement does not survive intact: its “even part” is proved, but its “odd composite part” has the counterexample
\[
11563=31\times 373,\qquad K_{11563}\equiv 0\pmod{11563}.
\]
This shows that the determinant formalism is equivalent to the original prime case, but not to a naively generalized composite case [1312.7037].

## 3. Computational verification and algorithmic development

The computational history recorded in the supplied sources shows a rapid increase in verified range.

| Paper | Verified range | Reported outcome |
|---|---:|---|
| [1312.7037] | \(n<1{,}000{,}000\) | verified by computer |
| [1409.0800] | \(p<2^{34}\) | no counterexample |
| [1904.09196] | \(p<2^{40}\) | no odd prime \(p\) divides \( !p \) |

The 2014 search extended the range to all odd primes \(p<2^{34}\), improving on a previous literature bound of \(p<1.44\times 10^8\) by a factor of roughly \(11{,}300\). For each prime, the residue \(r_p=!p\bmod p\) was computed, and no counterexample was found. The same computation confirmed previously known residues for smaller primes, and it recorded, for example, that for \(r_p=1\) only \(p=3\) and \(p=11\) remained as solutions up to \(2^{34}\), while for \(r_p=2\) a new solution appeared at \(p=6{,}855{,}730{,}873\) [1409.0800].

That search introduced recurrences and regroupings that reduced the number of modular reductions by a factor of \(2\), and it used modular arithmetic techniques such as Montgomery reduction and inverse multiplication. Its GPU implementation in OpenCL ran on two AMD Radeon R9 280x GPUs with a combined double-precision peak of \(2\) teraFLOPS. The code exploited SIMD parallelism, loop unrolling, and instruction pairing, obtaining over \(150\times\) speedup compared to earlier CPU implementations for \(p<2^{32}\). The full search to \(2^{34}\) took about \(240\) days, and random values were rechecked on a CPU using high-precision arithmetic, including over \(200{,}000\) values and \(20\) million additional cases, all matching the GPU results [1409.0800].

A key recurrence used there is
\[
s_i=(m_{i-1}s_{i-1}+1)\bmod p,
\]
with
\[
m_1=10,\qquad k_1=18,\qquad m_i=m_{i-1}+k_{i-1},\qquad k_i=k_{i-1}+8,
\]
and final residue
\[
r_p=1+3s_{p-3}\bmod p.
\]
This recurrence was designed specifically for high-throughput modular evaluation of left factorial residues [1409.0800].

The 2019 paper replaced the earlier linear-in-\(p\) paradigm with substantially faster methods. It represents simultaneous computation of \(n!\) and \( !n \) by the matrix product
\[
M_n=C_1C_2\cdots C_n=
\begin{pmatrix}
n! & !n\\
0 & 1
\end{pmatrix},
\qquad
C_k=
\begin{pmatrix}
k & 1\\
0 & 1
\end{pmatrix}.
\]
From this, a single-prime computation of \( !p\bmod p \) is obtained in \(O(p^{0.5+\varepsilon})\) time, while batch computation for all primes in an interval \([m,n]\) is achieved in total time \(O(n\log^{3+\varepsilon}n)\) using product trees and remainder trees [1904.09196].

The same work reports a complete computation for all odd primes \(p<2^{40}\), again with no counterexample to Kurepa’s conjecture. Its implementation used GMP, NTT, FLINT, and NTL, on a 6-core Intel i7 with \(64\)GB RAM and a \(16\)TB SSD, for about \(33{,}000\) core-hours, with \(65\)–\(80\%\) of time spent in the phase computing \(M_m\bmod P_{0,0}\). A substantial subset of values was independently verified using the direct \(O(p^{0.5+\varepsilon})\) algorithm [1904.09196].

Heuristic analysis in the computational literature treats \( !p\bmod p \) as “randomly” distributed for odd primes. On that basis, the expected number of counterexamples below \(x\) is roughly \(\ln(\ln x)\); for \(p<2^{34}\), the chance of finding a counterexample was estimated at about \(20\%\), and a \(50\%\) chance would require searching to \(p<2^{68}\), described there as computationally infeasible with current technology [1409.0800]. Earlier heuristic remarks similarly emphasized extreme sparsity, with an expected number of violations up to \(10^{19}\) of about \(1\) [1312.7037].

## 4. Generalized left factorials

The standard left factorial admits a natural power-generalization. For \(k\ge 1\),
\[
!_k n=(0!)^k+(1!)^k+\cdots+((n-1)!)^k,
\]
with \( !_1 n=!n \). The 2014 computational study also examined the divisibility problem for these generalized sums [1409.0800].

In contrast with the original conjecture, the generalized version fails very widely in the tested range. For each integer \(1<k<100\), the authors gave an explicit odd prime \(p\) such that
\[
p\mid !_k p.
\]
Thus, for every such \(k>1\), there exists a prime counterexample to the direct analog of Kurepa’s conjecture [1409.0800].

The case \(k=5\) is singled out in the source as a previously open instance, resolved there by the example
\[
p=9{,}632{,}267,\qquad p\mid !_5 p.
\]
This sharply separates the arithmetic behavior of the classical left factorial from that of its power-generalized variants [1409.0800].

## 5. Later algebraic reformulations and recent claims

A 2025 preprint develops what it describes as a new algebraic equivalence for the Kurepa factorial. It introduces a **Kurepa polynomial**
\[
\mathbb{F}_n(x)=\sum_{k=0}^{n}k!x^k
\]
and a **half-Kurepa polynomial**
\[
r_n(x)=\sum_{k=0}^{n}\frac{k!}{2}x^k,
\]
with \(\mathbb{F}_n(x)=2\,r_n(x)\). In the same source, the left factorial conjecture is reformulated through “half-Kurepa” quantities as
\[
\gcd(!n,n!)=2 \qquad \Leftrightarrow \qquad \gcd(r_{n-1},n!/2)=1,
\]
together with the recursion
\[
r_n=r_{n-1}+\frac{n!}{2}.
\]
The paper states that this perspective is inductive and that the table of values presented there shows \(r_n\) is always odd for \(n\ge 3\) [2509.06077].

The same preprint also proposes decompositions of the Kurepa factorial in terms of Bell numbers and Dobinski numbers. With coefficients \(\Phi_r\) described there as depending on \(n\),
\[
!n=\sum_{r=1}^{n}\Phi_r\,\mathbf{Bell}_r,
\qquad
!n\,e=\sum_{r=1}^{n}\Phi_r\,\mathbf{Dob}_r.
\]
It further gives a formula involving derangement numbers,
\[
!n\cdot n!=\sum_{r=1}^{n}\Phi_r\,\mathrm{Der}_r\cdot \mathbf{Dob}_r,
\]
and connects these decompositions to partition functions, occupation numbers, Bose–Einstein and Fermi–Dirac statistics, and normal ordering in bosonic operator algebras [2509.06077].

A separate 2022 preprint bears the title **“Kurepa’s conjecture on the left factorial function is true”** and has the abstract sentence “We answer Kurepa’s conjecture on the left factorials in affirmative” [2209.12677]. However, the available data accompanying that entry explicitly states that no full text or content was accessible there, and that no mathematical arguments, proofs, or summary of findings could be drawn from the material provided. On the basis of the supplied record alone, the preprint can be cited as a bibliographic event, but not as a source of documented proof details [2209.12677].

## 6. Terminological scope and adjacent uses of “Kurepa”

The name **Kurepa** also appears in subjects that are distinct from the left factorial. One is the **Kurepa functional equation**
\[
F(x+y,z)+F(x,y)=F(y,z)+F(x,y+z),
\]
studied in a 2025 paper that proves constructive representation results for continuous and \(C^k\) solutions. That paper states that all regular solutions have the form
\[
F(x,y)=g(x+y)-g(x)-g(y),
\]
building on classical results of Kurepa and Erdős and using de Bruijn’s difference property. The same source notes that the Kurepa factorial is not analyzed directly there, although it describes the factorial as historically related to the motivations for studying the equation [2501.08949].

Another distinct usage is the **Generalized Kurepa Hypothesis** in set theory. For infinite cardinals \(\lambda<\kappa\), a \(KH(\kappa,\lambda)\)-family is a family \(\mathcal F\) of subsets of \(\kappa\) such that \(|\mathcal F|\ge \kappa^+\) and \(|\mathcal F\upharpoonright x|<\lambda\) for all \(x\in[\kappa]^\lambda\). The **Gap-\(n\)-Kurepa hypothesis** asserts that \(KH(\lambda^{+n},\lambda)\) holds for all infinite cardinals \(\lambda\). A 2015 paper shows, relative to an inaccessible cardinal, that Gap-\(n\)-Kurepa hypotheses are independent of one another. That work explicitly does not directly reference the Kurepa factorial [1510.02932].

For the number-theoretic topic of the Kurepa factorial, these neighboring uses are primarily terminological. They share the historical name but concern different mathematical structures: factorial sums and prime divisibility in one case, cocycle-type functional equations in another, and set-theoretic combinatorics in a third [2501.08949] [1510.02932].

Source: https://www.emergentmind.com/topics/kurepa-factorial