Let $ p$ and $ q$ be two coprime positive integers, and $ n$ be a non-negative integer. Determine the number of integers that can be written in the form $ ip + jq$, where $ i$ and $ j$ are non-negative integers with $ i + j \leq n$.
Problem
Source: CGMO 2004 P7
Tags: number theory unsolved, number theory
28.12.2008 18:14
The main idea is that, if you have a solution of $ px + qy = t$, the other solutions are obtained by adding $ p$ to $ y$ and subtracting $ q$ to $ x$ or viceversa. Suppose $ p \ge q$. $ \{ip + jq|i + j \le n\} = \{ip + jq|i + j \le n \text{ and } j < p\}$ (all variables are non-negative) Proof: take an arbitrary number $ a = ip + jq$. Let $ j = pu + t$, where $ t < p$. Then $ a = (i + qu)p + (j - pu)q = i'p + j'q$. Clearly $ i' + j' = i + j + (q - p)u \le i + j \le n$ and $ j' = t < p$. We also have $ i', j' \ge 0$. Now, we can see that $ ip + jq$ determines $ (i, j)$ if $ j < p$ (if there are such $ i$ and $ j$). Indeed, $ ip + jq = Ip + Jq \Rightarrow p|q(J - j) \Rightarrow p|J - j$. If $ 0 \le J < p$ and $ 0 \le j < p$, this implies $ J = j$. This obviously imply $ I = i$, i.e., the pair is determinated, as I claimed. From these results, we conclude that we just need to compute $ \{(i, j)|i + j \le n \text{ and } j < p\}$. It is not difficult if you know how to compute the numbers of solutions of $ i + j \le n$, which is $ \binom{n + 2}{2}$. Reply if you have trouble... P.S.: does somebody know how to make the and in mathematical notation?
28.12.2008 19:00
Consider n=3, (p,q)=(2,3). Then the integers possible are: 0,2,3,4,5,6,7,8,9 which is not equal to $ {5 \choose 2}$ The reason: We are counting the set of lattice points in the plane where the point (x,y) represents px+qy. Let $ A$ be the region bounded by the axes and the line $ x+y=n$; then the upper bound for the answer as found by feliz is $ {n+2 \choose 2}$ which simply counts the number of lattice points. However, some lattice points represent the same number - precisely when the two points lie on a line parallel to $ xp+yq=0$. Now I haven't really thought this through but something like the following tweaked should work the maximum integer represented is clearly np where p is max(p,q) If np>=(p-1)(q-1) then we have an answer as follows: As follows from pick's theorem, there are precisely (p-1)(q-1)/2 numbers NOT represented in the specific form. Thus the answer is (np+1)-(p-1)(q-1)/2 Otherwise, suppose n>=q; then np>=pq>(p-1)(q-1), contradiction. So p>q>n. But then, we see that the answer must be $ { n+2\choose 2}$
28.12.2008 23:02
me@home wrote: Consider n=3, (p,q)=(2,3). Then the integers possible are: 0,2,3,4,5,6,7,8,9 which is not equal to $ {5 \choose 2}$ But the answear is $ 9 = \binom{5}{2} - \binom{2}{2} = \binom{n + 2}{2} - \binom{n - max\{p, q\} + 2}{2}$. I have no time to look for a counter example now, but, if you find, please show it. I think this formula works for $ n \ge max\{p, q\}$.