๐Ÿงฎ Brain Teaser

Sums That Know Their Parts

Let nn be a fixed positive integer. How many ways are there to write nn as a sum of positive integers

n=a1+a2+โ‹ฏ+ak,n = a_1 + a_2 + \cdots + a_k,

where kk is an arbitrary positive integer and a1โ‰คa2โ‰คโ‹ฏโ‰คakโ‰คa1+1a_1 \leq a_2 \leq \cdots \leq a_k \leq a_1 + 1?

For example, with n=4n = 4 there are four ways: 4,โ€…โ€Š2+2,โ€…โ€Š1+1+2,โ€…โ€Š1+1+1+14,\; 2+2,\; 1+1+2,\; 1+1+1+1.

(Putnam 2003, A1)

integer partitionsdivisorsEuclidean divisioncombinatoricsPutnam 2003

Answer: Sums That Know Their Parts

Key Idea / Intuition

The constraint a1โ‰คa2โ‰คโ‹ฏโ‰คakโ‰คa1+1a_1 \leq a_2 \leq \cdots \leq a_k \leq a_1 + 1 forces all the aia_i to be nearly equal โ€” they can take at most two consecutive integer values. So a valid partition of nn into kk parts is really just a way to write n=kโ‹…q+rn = k \cdot q + r where rr parts equal q+1q+1 and kโˆ’rk - r parts equal qq. The number of such decompositions turns out to equal the number of divisors of nn.

The key observation: a valid representation is completely determined by the choice of kk (the number of parts), because once you fix kk, the Euclidean division n=kq+rn = kq + r (with 0โ‰คr<k0 \le r < k) uniquely determines qq and rr, hence the entire multiset {q,โ€ฆ,q,q+1,โ€ฆ,q+1}\{q, \ldots, q, q+1, \ldots, q+1\}.


Formal Proof / Solution

Step 1: Characterize valid representations.

Suppose n=a1+a2+โ‹ฏ+akn = a_1 + a_2 + \cdots + a_k with a1โ‰คa2โ‰คโ‹ฏโ‰คakโ‰คa1+1a_1 \leq a_2 \leq \cdots \leq a_k \leq a_1 + 1.

Since consecutive terms differ by at most 11, and the sequence is non-decreasing with max โ‰คminโก+1\leq \min + 1, every aia_i is either โŒŠn/kโŒ‹\lfloor n/k \rfloor or โŒˆn/kโŒ‰\lceil n/k \rceil. More precisely, there exist integers qโ‰ฅ1q \geq 1 and 0โ‰คr<k0 \leq r < k such that:

  • rr of the parts equal q+1q+1, and
  • kโˆ’rk - r of the parts equal qq,

giving n=r(q+1)+(kโˆ’r)q=kq+rn = r(q+1) + (k-r)q = kq + r, i.e., q=โŒŠn/kโŒ‹q = \lfloor n/k \rfloor and r=nmodโ€‰โ€‰kr = n \mod k.

Step 2: Each kk gives exactly one representation.

For any kk with 1โ‰คkโ‰คn1 \leq k \leq n, the Euclidean division n=kq+rn = kq + r with 0โ‰คr<k0 \leq r < k is unique. This uniquely defines the multiset of parts (all qq's and (q+1)(q+1)'s). We need qโ‰ฅ1q \geq 1, which holds iff kโ‰คnk \leq n.

So there is exactly one valid representation for each kโˆˆ{1,2,โ€ฆ,n}k \in \{1, 2, \ldots, n\}. But wait โ€” do we require all parts to be positive? Yes: q=โŒŠn/kโŒ‹โ‰ฅ1q = \lfloor n/k \rfloor \geq 1 iff kโ‰คnk \leq n. โœ“

Step 3: Count the representations.

Every kโˆˆ{1,2,โ€ฆ,n}k \in \{1, 2, \ldots, n\} yields a valid representation. But wait โ€” should we count separately representations that differ only by kk?

Let's verify with n=4n = 4:

  • k=1k=1: 44 โœ“
  • k=2k=2: 2+22+2 โœ“
  • k=3k=3: 1+1+21+1+2 โœ“
  • k=4k=4: 1+1+1+11+1+1+1 โœ“

That's 4 representations for n=4n=4, and indeed all values k=1,2,3,4k=1,2,3,4 are valid.

Step 4: Identify which kk are valid โ€” the divisor connection.

Actually, let's be more careful. A representation has r=0r=0 (all parts equal) if and only if kโˆฃnk \mid n. In that case it's a uniform partition. If r>0r > 0, the parts are not all equal but still valid. Every kโˆˆ{1,โ€ฆ,n}k \in \{1, \ldots, n\} gives a valid, distinct representation (different kk means different number of parts).

Therefore, the total number of valid representations equals nn.

n\boxed{n}

Check: n=1n=1: only 11 itself. โœ“ ย  n=2n=2: 22 and 1+11+1. โœ“ ย  n=3n=3: 33, 1+21+2, 1+1+11+1+1. โœ“ ย  n=4n=4: four ways, as given. โœ“

Source: Putnam 2003, Problem A1

Type: PutnamSource: Putnam 2003, Problem A1Edit on GitHub โ†—