How Many Good Permutations?

A permutation ( a 1 , a 2 , , a 2014 ) (a_1, a_2, \cdots , a_{2014}) of ( 1 , 2 , , 2014 ) (1, 2, \cdots , 2014) is called good if for all positive integers k 2014 , k \leq 2014, 2 ( a 1 + a 2 + + a k ) 2 (a_1 + a_2 + \cdots + a_k) is a multiple of k . k. Find the last three digits of the number of good permutations of ( 1 , 2 , , 2014 ) . (1, 2, \cdots , 2014).

Details and assumptions

  • The general condition is k 2 i = 1 k a i k \mid \displaystyle 2 \displaystyle \sum_{i=1}^{k} a_i for all positive integers k 2014. k \leq 2014.

  • This problem is not original.

Image credit: Wikipedia Nicolae-boicu


The answer is 288.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Let E k E_k denote the number of good permutations of ( a 1 , a 2 , , a k ) . (a_1, a_2, \cdots , a_k).

Claim: E k + 1 = 2 E k k N 3 E_{k+1} = 2 E_k \quad \forall \ k \in \mathbb{N_{\geq 3}}

Proof: Let ( a 1 , a 2 , , a k , a k + 1 ) (a_1, a_2, \cdots , a_k, a_{k+1}) be any good permutation of ( 1 , 2 , , k ) . (1, 2, \cdots , k). Note that k 2 ( a 1 + a 2 + + a k ) k 2 ( a 1 + a 2 + + a k + 1 ) 2 a k + 1 k 2 ( 1 + 2 + + ( k + 1 ) ) 2 a k + 1 k ( k + 1 ) ( k + 2 ) 2 a k + 1 . \begin{array}{lcl} k \mid 2(a_1 + a_2 + \cdots + a_k) & \implies & k \mid 2(a_1 + a_2 + \cdots + a_{k+1} ) - 2a_{k+1} \\ & \implies & k \mid 2(1+2 + \cdots + (k+1)) - 2 a_{k+1} \\ & \implies & k \mid (k+1)(k+2) - 2 a_{k+1} . \end{array} But, ( k + 1 ) ( k + 2 ) 2 a k + 1 1 2 = 2 a k + 1 2 ( 1 a k + 1 ) ( m o d k ) , (k+1)(k+2) - 2 a_{k+1} \equiv 1 \cdot 2 = 2 a_{k+1} \equiv 2 (1 - a_{k+1}) \pmod{k}, so 2 ( a k + 1 1 ) 2(a_{k+1}-1) must be a multiple of k . k. Thus, a k + 1 a_{k+1} is either 1 , k + 2 2 , 1, \dfrac{k+2}{2}, or k + 1 k+1 .

I claim a k + 1 k + 1 2 . a_{k+1} \neq \dfrac{k+1}{2}. Assume the contrary. Note that 2 ( a 1 + a 2 + + a k 1 ) = 2 ( a 1 + a 2 + + a k + 1 ) 2 a k 2 a k + 1 = 2 ( 1 + 2 + + ( k + 1 ) ) 2 a k ( k + 2 ) = ( k + 1 ) ( k + 2 ) ( k + 2 ) 2 a k 1 2 a k ( m o d k ) . \begin{array}{c}2(a_1 + a_2 + \cdots + a_{k-1}) & = & 2(a_1 + a_2 + \cdots + a_{k+1}) - 2a_k -2 a_{k+1} \\ & = & 2(1 + 2 + \cdots + (k+1)) - 2a_k - (k+2) \\ & = & (k+1)(k+2) - (k+2) - 2 a_k \\ & \equiv & 1 - 2 a_k \pmod{k}. \end{array} Thus, 2 a k 1 2a_k - 1 must be a multiple of k , k, so a k = k + 2 2 . a_k = \dfrac{k+2}{2}. But this implies a k = a k + 1 , a_k = a_{k+1}, contradiction.

Thus, a k + 1 a_{k+1} is either k + 1 k+1 or 1. 1. We have E k E_k good permutations of ( 1 , 2 , , k + 1 ) (1, 2, \cdots , k+1) where a k + 1 = k + 1. a_{k+1}= k+1. We also have E k E_k good permutations of k + 1 k+1 where a k + 1 = 1 a_{k+1}= 1 because for any good permutation ( a 1 , a 2 , , a n , a n + 1 ) (a_1, a_2, \cdots , a_n, a_{n+1} ) where a n + 1 = k + 1 , a_{n+1}= k+1, ( n + 2 ) a 1 , ( n + 2 ) a 2 , , ( n + 2 ) a 3 , , ( n + 2 ) a n + 1 ) (n+2)-a_1, (n+2) - a_2, \cdots , (n+2) - a_3, \cdots , (n+2) - a_{n+1}) forms a good permutation with its last element n + 2 ( n + 1 ) = 1. n+2 - (n+1)= 1. Thus, E k + 1 = E k + E k = 2 E k , E_{k+1}= E_k + E_k= 2 E_k, proving our claim. \blacksquare


Note that all permutations of ( 1 , 2 , 3 ) (1, 2, 3) are good, so E 3 = 3 ! = 6. E_3= 3!= 6. Now, solving the recurrence for E k E_k gives E k = 3 2 k 1 . E_k= 3 \cdot 2^{k-1}. Our desired answer is E 2014 = 3 2 2013 , \boxed{E_{2014} = 3 \cdot 2^{2013}}, whose last three digits are 288 . \boxed{288}.


This problem is adapted from ISL 2008 C2 .

There are lots of errors in the solution. Please amend them. But the idea is nice. I did the same, recursive method.

Himanshu Arora - 6 years, 12 months ago
Paul Sherman
May 20, 2014

Sreejato, I like your solution. I used basically the same method.

When constructing the good permutations of 1 , 2 , , n + 1 1,2, \dots, n+1 from good permutations of 1 , 2 , , n 1,2, \ldots, n , I preferred using the following two constructions:

  1. Simply append n + 1 n+1 to the end: ( a 1 , a 2 , , a n ) ( a 1 , a 2 , , a n , n + 1 ) (a_1, a_2, \ldots, a_n) \rightarrow (a_1, a_2, \ldots, a_n, n+1)

  2. Add 1 to each of them and then append 1 to the end: ( a 1 , a 2 , , a n ) ( a 1 + 1 , a 2 + 1 , , a n + 1 , 1 ) (a_1, a_2, \ldots, a_n) \rightarrow (a_1 + 1, a_2 + 1, \ldots, a_n + 1, 1)

(also, I think there is a typo in your proof. You wrote k + 2 2 \frac{k+2}{2} in two places where I think you meant k + 1 2 \frac{k+1}{2} )

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...