Olympiad Maths Prep

Track / Stage 7 / 134 of 300 #1534 of 2000

Problem 1534

National olympiad second round; IMO P1/P4
Combinatorics Difficulty 7.2 Find the answer

Let n1n \ge 1 be an integer. For each subset S{1,2,,3n}S \subset \{1, 2, \ldots , 3n\}, let f(S)f(S) be the sum of the elements of SS, with f()=0f(\emptyset) = 0. Determine, as a function of nn, the sum S{1,2,,3n}3f(S)f(S)\sum_{\mathclap{\substack{S \subset \{1,2,\ldots,3n\}\\ 3 \mid f(S)}}} f(S)
where SS runs through all subsets of {1,2,,3n}\{1, 2,\ldots, 3n\} such that f(S)f(S) is a multiple of 33.

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

1. Define the problem and notation:
We need to determine the sum
S{1,2,,3n}3f(S)f(S) \sum_{\substack{S \subset \{1,2,\ldots,3n\} \\ 3 \mid f(S)}} f(S)
where f(S) f(S) is the sum of the elements of S S and S S runs through all subsets of {1,2,,3n} \{1, 2, \ldots, 3n\} such that f(S) f(S) is a multiple of 3.

2. Sum of all elements:
The sum of all elements in {1,2,,3n} \{1, 2, \ldots, 3n\} is:
k=13nk=3n(3n+1)2 \sum_{k=1}^{3n} k = \frac{3n(3n+1)}{2}
This sum is divisible by 3 because 3n(3n+1)/2 3n(3n+1)/2 is an integer and 3n 3n is a multiple of 3.

3. Complementary subsets:
For any subset S{1,2,,3n} S \subset \{1, 2, \ldots, 3n\} , let Sc S^c be its complement. Then:
f(S)+f(Sc)=3n(3n+1)2 f(S) + f(S^c) = \frac{3n(3n+1)}{2}
Since 3n(3n+1)2 \frac{3n(3n+1)}{2} is divisible by 3, f(S) f(S) is a multiple of 3 if and only if f(Sc) f(S^c) is a multiple of 3.

4. **Sum of f(S) f(S) and f(Sc) f(S^c) :**
U=S{1,2,,3n}3f(S)f(S) U = \sum_{\substack{S \subset \{1,2,\ldots,3n\} \\ 3 \mid f(S)}} f(S)
By symmetry, we have:
U=S{1,2,,3n}3f(S)f(Sc) U = \sum_{\substack{S \subset \{1,2,\ldots,3n\} \\ 3 \mid f(S)}} f(S^c)
Therefore:
2U=S{1,2,,3n}3f(S)(f(S)+f(Sc))=3n(3n+1)2S{1,2,,3n}3f(S)1 2U = \sum_{\substack{S \subset \{1,2,\ldots,3n\} \\ 3 \mid f(S)}} (f(S) + f(S^c)) = \frac{3n(3n+1)}{2} \sum_{\substack{S \subset \{1,2,\ldots,3n\} \\ 3 \mid f(S)}} 1

5. **Number of subsets S S such that 3f(S) 3 \mid f(S) :**
Let an a_n denote the number of subsets S{1,2,,3n} S \subset \{1, 2, \ldots, 3n\} such that 3f(S) 3 \mid f(S) . Then:
2U=3n(3n+1)2an 2U = \frac{3n(3n+1)}{2} a_n
U=3n(3n+1)4an U = \frac{3n(3n+1)}{4} a_n

6. **Recursive relation for an a_n :**
Consider any subset S{1,2,,3n3} S' \subset \{1, 2, \ldots, 3n-3\} . We can adjoin one set from one of the following pairs to it:
- {3n} \{3n\} or {3n1,3n2} \{3n-1, 3n-2\} if 3f(S) 3 \mid f(S')
- {3n1} \{3n-1\} or {3n,3n1} \{3n, 3n-1\} if 3f(S)+1 3 \mid f(S') + 1
- {3n2} \{3n-2\} or {3n,3n2} \{3n, 3n-2\} if 3f(S)+2 3 \mid f(S') + 2

This gives us 2×23n3=23n2 2 \times 2^{3n-3} = 2^{3n-2} sets S{1,2,,3n} S \subset \{1, 2, \ldots, 3n\} with 3f(S) 3 \mid f(S) .

7. Counting subsets:
Any set not generated by this method must contain all of {3n,3n1,3n2} \{3n, 3n-1, 3n-2\} or none of it, and in either case, it is counted in an1 a_{n-1} . Hence:
an=2an1+23n2 a_n = 2a_{n-1} + 2^{3n-2}

8. Solving the recurrence:
Substitute bn=an2n b_n = \frac{a_n}{2^n} :
bn=bn1+4n1 b_n = b_{n-1} + 4^{n-1}
With a1=4 a_1 = 4 , we have b1=2 b_1 = 2 . Solving the recurrence:
bn=2+4+42++4n1=4n13+2=4n+23 b_n = 2 + 4 + 4^2 + \cdots + 4^{n-1} = \frac{4^n - 1}{3} + 2 = \frac{4^n + 2}{3}
Therefore:
an=2nbn=2n(4n+23)=2n+1(22n1+1)3 a_n = 2^n b_n = 2^n \left( \frac{4^n + 2}{3} \right) = \frac{2^{n+1}(2^{2n-1} + 1)}{3}

9. **Final expression for U U :**
U=3n(3n+1)4an=3n(3n+1)42n+1(22n1+1)3=2n1(22n1+1)n(3n+1) U = \frac{3n(3n+1)}{4} a_n = \frac{3n(3n+1)}{4} \cdot \frac{2^{n+1}(2^{2n-1} + 1)}{3} = 2^{n-1}(2^{2n-1} + 1)n(3n+1)

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.