Let $K$ and $N > K$ be fixed positive integers. Let $n$ be a positive integer and let $a_1, a_2, ..., a_n$ be distinct integers. Suppose that whenever $m_1, m_2, ..., m_n$ are integers, not all equal to $0$, such that $\mid{m_i}\mid \le K$ for each $i$, then the sum $$\sum_{i = 1}^{n} m_ia_i$$is not divisible by $N$. What is the largest possible value of $n$? Proposed by Ilija Jovcevski, North Macedonia
Problem
Source: BMO Shortlist 2021
Tags: Balkan, shortlist, 2021, combinatorics, Divisibility, maximum
09.05.2022 23:30
Answer: $\boxed{\lfloor \operatorname{log}_{K+1}(N) \rfloor}$. Consider the following set: \[ A = \{m_1a_1 + \dots m_na_n | 0 \le m_1, m_2, \dots, m_n \le K, (m_1, m_2, \dots, m_n) \neq (0, 0, \dots, 0) \}. \]We can see that $|A|=(K+1)^n-1$. If there exists two elements of $A$ which are equivalent $(\operatorname{mod} N)$, then their difference is divisible by $N$, and this number can be written as $t_1a_1 + \dots + t_na_n$, where $|t_i| \le K$ for each $i = 1, 2, \dots, n$, which violates the condition from the problem. Therefore, all of them must be different $(\operatorname{mod} N)$, and also none of them are divisible by $N$. So, \[ (K+1)^n-1 \le N-1 \implies n \le \lfloor \operatorname{log}_{K+1}(N) \rfloor. \] Denote $n_0 = \lfloor \operatorname{log}_{K+1}(N) \rfloor$, so $(K+1)^{n_0} \le N < (K+1)^{n_0+1}$. We prove that $n = n_0$ is possible using the following: \[\{a_1, a_2, \dots, a_{n_0}\} = \{ 1, (K+1), \dots, (K+1)^{n_0-1} \}.\]If there exist integers $m_1, m_2, ..., m_{n_0}$, not all equal to $0$, such that $|m_i| \le K$ for each $i$ and $\sum m_ia_i \equiv 0 \pmod{N}$, then by separating the terms $m_ia_i$ according to the sign of $m_i$, there exists two distinct elements of $A$ which are equivalent $(\operatorname{mod} N)$, or there exist an element of $A$ which is divisible by $N$. But this is impossible since each element of $A$ is positive and less than $N$ because \[ 0 < \sum_{i=1}^{n_0} m_ia_i \le \sum_{i=1}^{n_0} K(K+1)^{i-1} = (K+1)^{n_0} - 1 < N, \]and they are all distinct due to being different numbers written in base $K+1$.