This repository contains a Rust library and two command-line tools for investigating divisibility properties of central binomial coefficients.
The primary goal of these tools is to find pairs of numbers
-
kummer: A parallel search tool to find qualifying$n$ values for a given difference$k$ . -
check_pair: A simple program to verify if any specific pair$(n, n+k)$ satisfies the condition.
From Kummer's Theorem one easily obtains the condition:
For all primes
$p$ , the central binomial coefficient$\binom{2n}{n}$ is divisible by$p$ if and only if in the base$p$ representation of$n$ there is a digit$\ge\frac{p}{2}$ .
To check if two central binomials
The idea for this search came from AlphaProof finding a counterexample to a statement on https://www.erdosproblems.com/730, see comments there.
First you need to set up rust/cargo
A program to search for numbers 'n' where the pair (n, n + k) satisfies the Kummer condition
Usage: kummer [OPTIONS] <K>
Arguments:
<K> The offset 'k' to check for the primary pair (n, n + k)
Options:
-l, --limit <LIMIT> Optional upper limit for the search (exclusive)
-q, --quiet Suppress informational output
-v, --verbose... Increase verbosity. Use -v for debug messages
-h, --help Print help
-V, --version Print version
For instance, we can find all pairs of binomial coefficients --release argument to cargo, because the default debug build is much slower.
$ cargo run --release --bin kummer -- 3 --limit 10000000
Finished `release` profile [optimized + debuginfo] target(s) in 0.06s
Running `target/release/kummer 3 --limit 10000000`
[2025-09-09T08:43:06Z INFO kummer] Starting search with k=3 and initial chunk size 65536.
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 0 to 65535 (size 65536)...
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 22.953999ms
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 65536 to 196607 (size 131072)...
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 9.530029ms
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 196608 to 458751 (size 262144)...
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 10.782848ms
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 458752 to 983039 (size 524288)...
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 16.282519ms
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 983040 to 2031615 (size 1048576)...
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 34.815798ms
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 2031616 to 4128767 (size 2097152)...
3894942
[2025-09-09T08:43:06Z INFO kummer] -> Found n=3894942: intermediate checks for k=1..2: [true, true]
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 84.528874ms
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 4128768 to 8323071 (size 4194304)...
6218569
[2025-09-09T08:43:06Z INFO kummer] -> Found n=6218569: intermediate checks for k=1..2: [true, true]
4505065
[2025-09-09T08:43:06Z INFO kummer] -> Found n=4505065: intermediate checks for k=1..2: [true, true]
7506679
[2025-09-09T08:43:06Z INFO kummer] -> Found n=7506679: intermediate checks for k=1..2: [true, true]
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 206.133486ms
[2025-09-09T08:43:06Z INFO kummer] Processing chunk: n = 8323072 to 9999999 (size 1676928)...
8879450
[2025-09-09T08:43:06Z INFO kummer] -> Found n=8879450: intermediate checks for k=1..2: [true, true]
[2025-09-09T08:43:06Z INFO kummer] ...-> Chunk processed in 127.393962ms
[2025-09-09T08:43:06Z INFO kummer] Search complete.The logging to stderr, also shows when it found a valid pair
If you are only interested in the sequence of numbers, you can get them by redirecting stderr:
$ cargo run --release --bin kummer -- 3 --limit 10000000 2> /dev/null
3894942
4505065
7506679
6218569
8879450A simple program to check the Kummer condition for a pair of numbers (n, n + k)
Usage: check_pair [OPTIONS] <N> <K>
Arguments:
<N> The first number in the pair (n)
<K> The offset for the second number (k)
Options:
-e, --exclude <PRIME> A prime number to exclude from the check (can be used multiple times)
-h, --help Print help
-V, --version Print version
For instance you can check (in less than 1min) that for
$ cargo run --release --bin check_pair -- 15555748327 5
Checking pair of central binomials (15555748327, 15555748332) for odd primes factors <= 31111496664 ...
✅ Success! Their binomial coefficients have the same prime factors.
Optionally, you can check if they have the same prime factors, except for an exceptional set of primes:
$ cargo run --release --bin check_pair -- 2381725 2
Finished `release` profile [optimized + debuginfo] target(s) in 0.05s
Running `target/release/check_pair 2381725 2`
Checking pair of central binomials (2381725, 2381727) for odd primes factors <= 4763454 ...
✅ Success! Their binomial coefficients have the same prime factors.⏎
$ cargo run --release --bin check_pair -- 2381725 1
Finished `release` profile [optimized + debuginfo] target(s) in 0.05s
Running `target/release/check_pair 2381725 1`
Checking pair of central binomials (2381725, 2381726) for odd primes factors <= 4763452 ...
❌ Nope. Their binomial coefficients have the different prime factors.⏎
$ cargo run --release --bin check_pair -- 2381725 1 --exclude 3
Finished `release` profile [optimized + debuginfo] target(s) in 0.05s
Running `target/release/check_pair 2381725 1 --exclude 3`
Checking pair of central binomials (2381725, 2381726) for odd primes factors <= 4763452 ...
✅ Success! Their binomial coefficients have the same prime factors. (Not checking the primes from [3])In ./src/lib.rs there are a few interesting examples as test cases. Those can be run with
time cargo test --release
or if you also want to test the ones that take a longer time with
time cargo test --release -- --include-ignored
AlphaProof found the example
A search yields many more such examples, with
For all of those the pair
There are also pairs
For those the prime factors for the central binomial in the middle only differ by a prime factor of
There are numbers
There are numbers where
In those cases, the binomial condition is satisfied for
There are numbers
There are numbers where
In this case, the binomial condition is satisfied for
There are numbers
There are no such pairs for
(discussion by Salvatore Mercuri)
Here we discuss a necessary condition for which the binomial condition can occur of gap size
Lemma. An odd prime
Proposition. If the binomial condition is satisfied for
Proof.
Note that
Claim:
Take an odd prime
Claim:
Take an odd prime
Claim: If
If
This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.