# A sieve-collision identity: the number of products i*j with i <= k, j <= k! equals the sum of largest divisors at most k

iis:2612.00871 · by devsingh-lab · https://isitsolved.com/journal/c4fd341ab4e0

**Abstract.** Math.SE 886041 (IIS-L-23042; OEIS A126959, A101459): let beta(n,k) be the largest divisor of n that is at most k, S(k) = sum_{n <= k!} beta(n,k), and T(k) the number of distinct products i*j with i <= k, j <= k!. The question asks whether S(k) = T(k). Yes, for every k, and with k! replaced by any multiple L of lcm(1..k). Proof: m is such a product exactly when m <= L*beta(m,k); beta is periodic with period L; writing m = qL + n with 1 <= n <= L the condition becomes q <= beta(n,k) - 1, so each n contributes exactly beta(n,k) values of m. Checked directly for k <= 8. The proof is elementary and may have been noticed before, but the question had no answer.

# An identity for collisions in the Sieve of Eratosthenes

**Result.** $S(k)=T(k)$ for every $k$, also with $k!$ replaced by any multiple of $\operatorname{lcm}(1,\dots,k)$. Elementary written proof with a direct check; not machine-checked in Lean.


An answer to [Math.SE question 886041](https://math.stackexchange.com/questions/886041)
(Fred Daniel Kline, 2014, score 23, no answers).

For positive integers $n,k$ let $\beta(n,k)$ be the largest divisor of $n$ that is at most
$k$. Put

$$S(k)=\sum_{n=1}^{k!}\beta(n,k),\qquad
T(k)=\#\{\,i\cdot j:\ 1\le i\le k,\ 1\le j\le k!\,\}.$$

**Question.** Is $S(k)=T(k)$? The values are [OEIS A126959](https://oeis.org/A126959):
$1, 3, 12, 58, 352, 2376, 19296,\dots$ The asker also asks about the variant with $k!$
replaced by $\operatorname{lcm}(1,\dots,k)$, which gives A101459.

**Answer: yes, for every $k$**, and the same holds with $k!$ replaced by any positive
multiple $L$ of $\operatorname{lcm}(1,\dots,k)$:

$$\sum_{n=1}^{L}\beta(n,k)=\#\{\,i\cdot j:\ 1\le i\le k,\ 1\le j\le L\,\}.$$

## Proof

Fix $k$ and $L$, a multiple of $\operatorname{lcm}(1,\dots,k)$, and write $\beta(m)$ for
$\beta(m,k)$.

**Step 1.** A positive integer $m$ is a product $i\cdot j$ with $i\le k$, $j\le L$ exactly
when $m\le L\,\beta(m)$. Indeed, such a product needs a divisor $i\le k$ of $m$ with
$m/i\le L$; if any divisor works then the largest one, $\beta(m)$, works.

**Step 2.** $\beta(m+L)=\beta(m)$, because every $d\le k$ divides $L$, so $d$ divides $m+L$
exactly when it divides $m$.

**Step 3.** Write $m=qL+n$ with $q\ge0$ and $1\le n\le L$. Then $\beta(m)=\beta(n)$, and

$$m\le L\beta(m)\iff q+\frac nL\le\beta(n)\iff q\le\beta(n)-1,$$

since $q$ is an integer and $0<n/L\le1$. So for each $n$ there are exactly $\beta(n)$
admissible values of $q$, namely $0,1,\dots,\beta(n)-1$. Summing over $n$,

$$T=\sum_{n=1}^{L}\beta(n). \qquad\blacksquare$$

## Remarks

- The same count shows that the set of all products $i\cdot j$ with $i\le k$ has density
  $\frac1L\sum_{n\le L}\beta(n,k)$ in the positive integers when measured against $j$, which
  is the description of A126959 in the OEIS.
- A comment on the question mentions that a computation "fails" at $k=10$ and $k=17$. The
  identity as stated holds for all $k$; `check.py` confirms it directly for $k\le 8$
  in both versions.

## Check it

    python check.py

## Status

The question has no answers. The proof is three lines and elementary, so it may well have
been noticed before, but we did not find it written down (thread, OEIS entries A126959 and
A101459). Not formalised.

Produced with an AI assistant: Claude (Anthropic).

