Maths Olympiad Prep

Library / /12 of 17

, 2014

Combinatorics Difficulty 6.6 National olympiad Prove it Canada

Let pp be a fixed odd prime. A pp-tuple (a1,a2,a3,,ap)(a_1, a_2, a_3, \dots, a_p) of integers is said to be good if
(i) 0aip10 \le a_i \le p-1 for all ii, and
(ii) a1+a2+a3++apa_1 + a_2 + a_3 + \dots + a_p is not divisible by pp, and
(iii) a1a2+a2a3+a3a4++apa1a_1a_2 + a_2a_3 + a_3a_4 + \dots + a_p a_1 is divisible by pp.
Determine the number of good pp-tuples.

Solution

Let SS be the set of all sequences (b1,b2,,bp)(b_1, b_2, \dots, b_p) of numbers from the set {0,1,2,,p1}\{0, 1, 2, \dots, p-1\} such that b1+b2++bpb_1 + b_2 + \dots + b_p is not divisible by pp. We show that S=pppp1|S| = p^p - p^{p-1}. For let b1,b2,,bp1b_1, b_2, \dots, b_{p-1} be an arbitrary sequence of numbers chosen from {0,1,2,,p1}\{0, 1, 2, \dots, p-1\}. There are exactly p1p-1 choices for bpb_p such that b1+b2++bp1+bp≢0(modp)b_1 + b_2 + \dots + b_{p-1} + b_p \not\equiv 0 \pmod{p}, and therefore S=pp1(p1)=pppp1|S| = p^{p-1}(p-1) = p^p - p^{p-1}.

Now it will be shown that the number of good sequences in SS is 1pS\frac{1}{p}|S|. For a sequence B=(b1,b2,,bp)B = (b_1, b_2, \dots, b_p) in SS, define the sequence Bk=(a1,a2,,ap)B_k = (a_1, a_2, \dots, a_p) by
ai=bib1+kmodp a_i = b_i - b_1 + k \bmod p
for 1ip1 \le i \le p. Now note that BB in SS implies that
a1+a2++ap(b1+b2++bp)pb1+pk(b1+b2++bp)≢0(modp) a_1 + a_2 + \dots + a_p \equiv (b_1 + b_2 + \dots + b_p) - pb_1 + pk \equiv (b_1 + b_2 + \dots + b_p) \not\equiv 0 \pmod{p}
and therefore BkB_k is in SS for all non-negative kk. Now note that BkB_k has first element kk for all 0kp10 \le k \le p-1 and therefore the sequences B0,B1,,Bp1B_0, B_1, \dots, B_{p-1} are distinct.

Now define the cycle of BB as the set {B0,B1,,Bp1}\{B_0, B_1, \dots, B_{p-1}\}. Note that BB is in its own cycle since B=BkB = B_k where k=b1k = b_1. Now note that since every sequence in SS is in exactly one cycle, SS is the disjoint union of cycles.
Now it will be shown that exactly one sequence per cycle is good. Consider an arbitrary cycle B0,B1,,Bp1B_0, B_1, \dots, B_{p-1}, and let B0=(b1,b2,,bp)B_0 = (b_1, b_2, \dots, b_p) where b0=0b_0 = 0, and note that Bk=(b1+k,b2+k,,bp+k)B_k = (b_1 + k, b_2 + k, \dots, b_p + k) mod pp. Let u=b1+b2++bpu = b_1 + b_2 + \dots + b_p, and v=b1b2+b2b3++bpb1v = b_1b_2 + b_2b_3 + \dots + b_pb_1 and note that (b1+k)(b2+k)+(b2+k)(b3+k)++(bp+k)(b1+k)=u+2kv(modp)(b_1 + k)(b_2 + k) + (b_2 + k)(b_3 + k) + \dots + (b_p + k)(b_1 + k) = u + 2kv \pmod p for all 0kp10 \le k \le p-1. Since 2v2v is not divisible by pp, there is exactly one value of kk with 0kp10 \le k \le p-1 such that pp divides u+2kvu + 2kv and it is exactly for this value of kk that BkB_k is good. This shows that exactly one sequence per cycle is good and therefore that the number of good sequences in SS is 1pS\frac{1}{p}|S|, which is pp1pp2p^{p-1} - p^{p-2}.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.