๐Ÿงฎ Brain Teaser

The Sequence That Sums to an Integer

Let a1,a2,โ€ฆ,ana_1, a_2, \ldots, a_n be a permutation of 1,2,โ€ฆ,n1, 2, \ldots, n. Call such a permutation sum-friendly if

a11+a22+a33+โ‹ฏ+annโˆˆZ.\frac{a_1}{1} + \frac{a_2}{2} + \frac{a_3}{3} + \cdots + \frac{a_n}{n} \in \mathbb{Z}.

Prove that for nโ‰ฅ2n \geq 2, if a permutation is sum-friendly, then it must swap at least one pair of elements (i.e., there exist iโ‰ ji \neq j such that ai=ja_i = j and aj=ia_j = i).

Wait โ€” actually, let's state the clean version:

Problem (Putnam 2005 B-1). Find a formula (closed form) for

โˆ‘k=0n(nk)(โˆ’1)kk+1.\sum_{k=0}^{n} \binom{n}{k} \frac{(-1)^k}{k+1}.

number theorybinomial coefficientsmodular arithmeticLucas theoremprimes

Answer: Central Binomial Coefficient mod Prime

Key Idea / Intuition

The central binomial coefficient (2pp)=(2p)!(p!)2\binom{2p}{p} = \frac{(2p)!}{(p!)^2} looks complicated, but modulo pp almost everything cancels. The numerator (2p)!(2p)! and denominator (p!)2(p!)^2 share many factors, and Wilson's theorem (or a direct product argument) reveals that all factors except two copies of "pp" cancel, leaving exactly 22 mod pp.


Formal Proof / Solution

Step 1: Write out the binomial coefficient.

(2pp)=(2p)!p!โ‹…p!=(2p)(2pโˆ’1)โ‹ฏ(p+1)p!.\binom{2p}{p} = \frac{(2p)!}{p! \cdot p!} = \frac{(2p)(2p-1)\cdots(p+1)}{p!}.

So we can write:

(2pp)=โˆk=1p(p+k)โˆk=1pk.\binom{2p}{p} = \frac{\prod_{k=1}^{p}(p+k)}{\prod_{k=1}^{p} k}.

Step 2: Analyze the numerator factor by factor mod pp.

For each kโˆˆ{1,2,โ€ฆ,p}k \in \{1, 2, \ldots, p\}:

p+kโ‰กk(modp).p + k \equiv k \pmod{p}.

Therefore:

โˆk=1p(p+k)โ‰กโˆk=1pk=p!(modpโ‹…p!)\prod_{k=1}^{p}(p+k) \equiv \prod_{k=1}^{p} k = p! \pmod{p \cdot p!}

Wait โ€” let's be more careful and work directly.

Step 3: Direct computation via the product formula.

(2pp)=โˆk=1pp+kk.\binom{2p}{p} = \prod_{k=1}^{p} \frac{p+k}{k}.

For k=pk = p: the factor is 2pp=2\frac{2p}{p} = 2.

For k=1,2,โ€ฆ,pโˆ’1k = 1, 2, \ldots, p-1: the factor is p+kk=1+pk\frac{p+k}{k} = 1 + \frac{p}{k}.

So:

(2pp)=2โ‹…โˆk=1pโˆ’1(1+pk).\binom{2p}{p} = 2 \cdot \prod_{k=1}^{p-1}\left(1 + \frac{p}{k}\right).

Step 4: Reduce modulo pp.

Each factor (1+pk)\left(1 + \frac{p}{k}\right) โ€” we want to think of this inside Z\mathbb{Z}. Since gcdโก(k,p)=1\gcd(k, p) = 1 for k=1,โ€ฆ,pโˆ’1k = 1, \ldots, p-1 (as pp is prime), each pk\frac{p}{k} is an integer multiple of pp divided by kk, but (2pp)\binom{2p}{p} is an integer so the full product is an integer.

More cleanly: write

(2pp)=(2p)!(p!)2.\binom{2p}{p} = \frac{(2p)!}{(p!)^2}.

By Lucas' theorem: for a prime pp, and writing 2p2p and pp in base pp:

2p=2โ‹…p+0,p=1โ‹…p+0.2p = 2 \cdot p + 0, \quad p = 1 \cdot p + 0.

Lucas' theorem states:

(2pp)โ‰ก(21)(00)=2โ‹…1=2(modp).\binom{2p}{p} \equiv \binom{2}{1}\binom{0}{0} = 2 \cdot 1 = 2 \pmod{p}.

Alternatively (elementary): Factor out the k=pk=p term:

(2pp)=(2p)(2pโˆ’1)โ‹ฏ(p+1)p!=2โ‹…(2pโˆ’1)(2pโˆ’2)โ‹ฏ(p+1)(pโˆ’1)!.\binom{2p}{p} = \frac{(2p)(2p-1)\cdots(p+1)}{p!} = 2 \cdot \frac{(2p-1)(2p-2)\cdots(p+1)}{(p-1)!}.

Now look at S:=(2pโˆ’1)(2pโˆ’2)โ‹ฏ(p+1)(pโˆ’1)!S := \frac{(2p-1)(2p-2)\cdots(p+1)}{(p-1)!}. The numerator is the product of integers p+1,p+2,โ€ฆ,2pโˆ’1p+1, p+2, \ldots, 2p-1 (that's pโˆ’1p-1 terms), and the denominator is (pโˆ’1)!(p-1)!, so S=(2pโˆ’1pโˆ’1)S = \binom{2p-1}{p-1} is an integer. Modulo pp:

โˆj=1pโˆ’1(p+j)โ‰กโˆj=1pโˆ’1j=(pโˆ’1)!(modp),\prod_{j=1}^{p-1}(p+j) \equiv \prod_{j=1}^{p-1} j = (p-1)! \pmod{p},

so

S=โˆj=1pโˆ’1(p+j)(pโˆ’1)!โ‰ก(pโˆ’1)!(pโˆ’1)!=1(modp).S = \frac{\prod_{j=1}^{p-1}(p+j)}{(p-1)!} \equiv \frac{(p-1)!}{(p-1)!} = 1 \pmod{p}.

Therefore:

(2pp)=2โ‹…Sโ‰ก2โ‹…1=2(modp).โ– \binom{2p}{p} = 2 \cdot S \equiv 2 \cdot 1 = 2 \pmod{p}. \qquad \blacksquare

Remark. This is actually the heart of why 1p(2pp)\frac{1}{p}\binom{2p}{p} โ€” which arises in Catalan number territory โ€” is always an integer that is โ‰ก2p\equiv \frac{2}{p}... but 2/p2/p only makes sense mod pp, hinting at deeper divisibility in the Catalan numbers.

Source: Mathematical folklore / Putnam preparation; Lucas' theorem standard reference

Type: PutnamSource: Mathematical folklore / Putnam preparation; Lucas' theorem standard referenceEdit on GitHub โ†—