restricted_base_ell_partition
For integers k, ℓ, and n, the restricted base-ℓ partition function b_{k,ℓ}(n) is the number of partitions of n into powers of ℓ where each part appears at most k times.
Statement
open scoped Classical in noncomputable def restricted_base_ell_partition (k ℓ n : ℕ) : ℕ
- Defined in
- arXiv:2611.08109 Section 1
- Verified
- 06 Nov 2026
- Axioms
- none listed
- Used by 1
- restricted_base_ell_partition_zeroFor any natural numbers $k$ and $\ell$, the restricted base-$\ell$ partition function evaluated at 0 is 1.
Read back from the Lean
A definition restricted_base_ell_partition taking three natural numbers k, ℓ, and n, and returning the number (cardinality) of partitions of n that simultaneously satisfy two conditions:
1. Every part i of the partition is a non-negative integer power of ℓ (i.e., there exists j : ℕ such that i = ℓ ^ j), via Nat.Partition.restricted.
2. The multiplicity (count) of each part in the partition is restricted by k + 1, via Nat.Partition.countRestricted n (k + 1) (meaning each part occurs fewer than k + 1 times, i.e., at most k times, or at most k + 1 times, according to Mathlib's convention).
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
open scoped Classical in /-- The number of partitions of n into powers of ℓ with each part appearing at most k times. -/ noncomputable def restricted_base_ell_partition (k ℓ n : ℕ) : ℕ := ((Nat.Partition.restricted n (fun i => ∃ j : ℕ, i = ℓ ^ j)) ∩ (Nat.Partition.countRestricted n (k + 1))).card