DR.WANG Mathematics中文

2013 USAJMO · Question 4

Counting & combinatorics · power of 2

Problem outline

Let f(n)f(n) count ordered lists with entries drawn from 1,2,4,8,…1,2,4,8,\ldots whose sum is nn. For example the one-term list (4)(4) and the two-term list (2,2)(2,2) are different. Find the least n>2013n>2013 with f(n)f(n) odd.

Show answer and methods 2 methods

Answer

2047=211−12047=2^{11}-1.

Method 1 Pair unequal powers in the parity recurrence

Allow the empty list at 00, so f(0)=1f(0)=1. Choosing the last part gives f(n)=∑2j≤nf(n−2j)f(n)=\sum_{2^j\le n} f(n-2^j) for n>0n>0, with j≥0j\ge0. We claim f(n)f(n) is odd exactly when n+1n+1 is a power of two, true at 00.

Assume this for smaller inputs. The odd terms in the recurrence correspond to ordered exponent pairs (j,k)(j,k) satisfying n+1=2j+2kn+1=2^j+2^k, because n−2j+1n-2^j+1 must be a power of two. Swapping j,kj,k pairs up all solutions with unequal exponents. Thus the parity equals the number of diagonal pairs j=kj=k, modulo two.

There is one such pair when n+1=2j+1n+1=2^{j+1} and none otherwise. This proves the claim by induction. The first power of two above 20142014 is 20482048, giving n=2047n=2047.

Method 2 Invert a formal series modulo two

In power series with coefficients modulo two, set S=x+x2+x4+x8+⋯S=x+x^2+x^4+x^8+\cdots. Lists of length kk have generating function SkS^k. Thus F=∑n≥0f(n)xn=1+S+S2+⋯F=\sum_{n\ge0}f(n)x^n=1+S+S^2+\cdots satisfies (1+S)F=1(1+S)F=1. Each coefficient uses only finitely many list lengths.

Squaring in characteristic two cancels every mixed term, so S2=x2+x4+x8+⋯=S+xS^2=x^2+x^4+x^8+\cdots=S+x. It follows that S(1+S)=xS(1+S)=x, hence F=S/x=1+x+x3+x7+⋯F=S/x=1+x+x^3+x^7+\cdots. Its nonzero coefficients occur exactly at 2k−12^k-1, and the first such exponent above 20132013 is 20472047.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)