---
title: Local Postage Stamp Problem
url: https://www.emergentmind.com/topics/local-postage-stamp-problem
type: topic
---

# Local Postage Stamp Problem

The local postage stamp problem concerns the representability of integers as sums of a bounded number of elements—termed "stamps"—drawn (with repetition) from a finite set of positive integer denominations. Formally, for a finite, strictly increasing set of denominations $A_k = \{a_1, a_2, \ldots, a_k\}$ with $a_1 = 1$, and an envelope capacity $s \in \mathbb{N}$, the problem is to determine the largest integer $N$ such that every $n$ with $0 \leq n \leq N$ can be written as $\sum_{j=1}^k \lambda_j a_j$ with $\sum_{j=1}^k \lambda_j \leq s$ where the $\lambda_j$ are nonnegative integers. This maximum $N$ is denoted $n_s(A_k)$, and the local postage stamp problem (LPSP) is to compute $n_s(A_k)$ (or equivalently, $f(A_k,s) = n_s(A_k) + 1$, the least non-representable value) for inputs $(A_k, s)$ [2601.21423].

## 1. Formal Problem Statement and Variants

Given a set $A_k$ of $k$ pairwise distinct positive integers $1 = a_1 < a_2 < \cdots < a_k$ and envelope capacity $s$, an integer $n \geq 0$ is said to be *$s$-coverable* by $A_k$ if there exist nonnegative integers $\lambda_1, \ldots, \lambda_k$ with $\sum_{j=1}^k \lambda_j \leq s$ and $\sum_{j=1}^k \lambda_j a_j = n$. The local postage stamp problem is then to compute $n_s(A_k)$, the largest $N$ such that all $0, \ldots, N$ are $s$-coverable [2601.21423]. Equivalently, the smallest non-coverable value is $f(A_k, s) = N+1$.

This is distinct from the global postage stamp problem, where for given $k$ and $s$ one seeks $A_k$ maximizing $n_s(A_k)$.

A related additive basis formulation considers an *order-$h$ additive basis* for $[n] = \{1,2,...,n\}$ as any set $A \subset \mathbb{N}$ such that every $x \in [n]$ can be written as a sum of at most $h$ elements of $A$. The minimum cardinality of such a basis is denoted $F_h(n)$. This is equivalent to the postage stamp interpretation: $F_h(n)$ is the minimal number of denominations needed so that all $x \leq n$ can be formed using at most $h$ stamps [2507.23627].

## 2. Complexity and Hardness Results

The LPSP is NP-hard under Turing reductions; this is established by reduction from the Subset-Sum and Partition problems [2601.21423]. Specifically, the decision version asks whether $f(A_k, s)$ exceeds a given bound, which can encode arbitrary instances of Subset-Sum in polynomial time under mild restrictions.

Despite NP-hardness, when the number of denominations $k$ is fixed, the problem becomes tractable by dynamic programming in time $O(s \cdot \max A_k)$ [2601.21423]. When both $k$ and $s$ are small or moderate, practical efficient algorithms are available.

## 3. Algorithmic Approaches

Recent work introduces algorithmic improvements over the traditional Mossige–Selmer $O(k s^2 a_k)$-time method. The primary innovation is an incremental dynamic programming (DP) algorithm that computes $n_s(A_k)$ in $O(k s a_k)$ time and $O(s a_k)$ space [2601.21423]. This algorithm maintains two arrays, $T$ and $U$ of length $M \geq s a_k$:

- $T[i]$: the minimal number of stamps needed to form $i$ (or $s + 1$ if $>s$ or "unknown").
- $U[i]$: index of largest denomination used in an optimal decomposition of $i$.

Processing $i$ from $0$ upward, for each $j = U[i], ..., k$ we attempt to relax $T[i + a_j]$. If $T[i + a_j] > T[i] + 1$, both $T$ and $U$ are updated accordingly. The process halts when $T[i] > s$, at which point $i - 1 = n_s(A_k)$.

A further *sliding-window* refinement replaces the arrays with cyclic buffers of length $2^{\lceil \log_2(a_k + 1)\rceil}$, yielding $O(a_k)$ space complexity. After processing each $i$, its slot is invalidated to enable buffer reuse.

Table: Comparison of Algorithmic Approaches for LPSP

| Algorithm                | Time Complexity        | Space Complexity   |
|--------------------------|-----------------------|--------------------|
| Mossige–Selmer           | $O(k s^2 a_k)$        | $O(s a_k)$         |
| Incremental DP           | $O(k s a_k)$          | $O(s a_k)$         |
| Sliding-Window DP        | $O(k s a_k)$          | $O(a_k)$           |

Empirical tests indicate speedups of $2\times$–$10\times$ for $s \geq 10$ over earlier methods, and the sliding-window variant typically yields an additional $20$–$30\%$ improvement thanks to smaller working sets. Implementations are available at https://github.com/jgdumas/GStamps [2601.21423].

## 4. Structural and Theoretical Properties

The structure of $s$-coverable numbers for given $(A_k, s)$ exhibits stabilization and eventual periodicity. For large enough $N$, the set of integers not expressible as a sum of $N$ elements of $A_k$ is determined by intrinsic properties of $A_k$ and its dual $b - A_k$, where $b = a_k$ [2003.04076].

Let $A = \{0 = a_1 < a_2 < \dots < a_k = b\}$ with $\gcd(A) = 1$. For each residue class $r$ mod $b$, define $n_{r,A}$ as the minimal nonnegative integer congruent to $r$ mod $b$ lying in $P(A) = \{n_1 a_1 + \cdots + n_k a_k : n_i \geq 0\}$, and $N_{r, A}$ as the least $N$ such that $n_{r,A}$ lies in the $N$-fold sumset $N \cdot A$. Then, letting $N_0 = \max_{1 \leq r \leq b - 1} (N_{r,A} + N_{b - r, b - A})$, it holds for all $N \geq N_0$ that expressed sums fill $[0, b N]$ except for $E(A) \cup (b N - E(b - A))$, where $E(A) = \mathbb{Z}_+ \setminus P(A)$ [2003.04076]. The number of "holes" $h(N)$ in $[0, b N]$ stabilizes to $|E(A)| + |E(b - A)|$ as $N \to \infty$.

These results link the LPSP to the classical Frobenius problem, specifying the structure of representable and nonrepresentable values under bounded and unbounded stamp usage.

## 5. Bounds and Extremal Results

The extremal function $F_h(n)$, the minimal size of an order-$h$ additive basis for $[n]$, equivalent to the number of needed stamp denominations, admits well-studied bounds [2507.23627]:

- **Trivial lower bound:** $F_h(n)^h \geq h! n$.
- **Trivial upper bound:** $F_h(n)^h \leq h^h n$.

Improved bounds have been obtained for large $h$:

- **Lower bound**: For any $\epsilon > 0$ and all $h$ sufficiently large,
  $$
  F_h(n)^h \geq (1/2 - \epsilon) h! \sqrt{2 \pi e} n.
  $$
  This employs probabilistic methods and the Berry–Esseen theorem, with the constant amplified by $\sqrt{2\pi e} / 2 \approx 1.266$ over the trivial term.
- **Upper bound**: For any $\epsilon > 0$ and all $h$ large,
  $$
  F_h(n)^h \leq \left( \left( \frac{\sqrt{3}}{2} + \epsilon \right) h \right)^h n.
  $$
  This result is obtained by lifting constructions of additive bases for cyclic groups $\mathbb{Z}/b\mathbb{Z}$ (Jia–Shen) to the integers.

Table: Numerical Comparison of Bounds for $h=10$, $n=10^6$

| Bound Type             | Stamp Count ($F_h(n)$)      |
|------------------------|-----------------------------|
| Trivial lower          | $17.9$                      |
| Improved lower         | $19.4$                      |
| Trivial upper          | $39.8$                      |
| Improved upper         | $34.5$                      |

The gap between lower and upper bounds narrows appreciably as $h$ increases, with the asymptotics revealing $F_h(n) \approx c(h) n^{1/h}$, where $c(h)^h$ is tightly sandwiched between $(2.066 - o(1)) h!$ and $((0.866 h)^h)$ for large $h$ [2507.23627].

## 6. Connections to Other Additive Problems

The local postage stamp problem generalizes and is closely related to classical results in additive number theory, notably the Frobenius problem (determining the largest integer not representable as a nonnegative linear combination of given relatively prime integers) [2003.04076]. As $s \to \infty$ or $N \to \infty$, the LPSP connects with the structure of the numerical semigroup $P(A)$ generated by $A$. The periodic stabilization of unattainable values and eventual coverage can be derived as corollaries of the constructive periodicity theorems for sumsets.

Moreover, LPSP and associated algorithmic advances have applications in secure multi-party computation, specifically in more efficient homomorphic evaluation of polynomials on encrypted values, facilitated by a more compact encoding of polynomials as sums of bounded integers [2601.21423].

## 7. Open Problems, Limitations, and Numerical Aspects

A principal open question is whether the lower and upper asymptotic bounds for $F_h(n)^h / n$ coincide as $h \to \infty$ [2507.23627]. While the gap has been substantially narrowed, a precise determination of the best possible constants remains unresolved.

Algorithmic advancements have made computation feasible for comparatively large $k$ and $s$, yet the underlying NP-hardness of LPSP limits exact methods for arbitrary parameters. The empirical performance of sliding-window DP shows substantial speedups but is still inherently exponential for very large $k$ or $s$.

Finally, continued work focuses on improving both theoretical bounds (particularly for moderate $h$) and practical algorithms, as well as elaborating connections to classical and higher-dimensional generalizations of the Frobenius and related additive problems. Further avenues include the development and analysis of approximation algorithms for the global postage stamp problem and analogues in higher-rank free abelian groups [2507.23627, 2601.21423, 2003.04076].

Source: https://www.emergentmind.com/topics/local-postage-stamp-problem