A 18 mile by 57 mile plot of land is divided into 1 0 2 6 counties of 1 mile by 1 mile squares. A man starts at the top right corner of the plot and travels a straight line path to the bottom left corner. In each county that he travels through, he spends − 4 times the sum of the amounts he spent in the previous two counties. He spends $1 in the first county and $2 in the second county. If he spends a × 2 b dollars in the last county, where a is odd and b ≥ 0 , find a + b .
This problem is posed by Jesse Z .
Details and assumptions
Spending a negative amount of money is equivalent to receiving money. As an explicit example, he receives $12 in the third county.
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.
Out of pure curiosity, what if a problem gave you have a m × n × k rectangular prism made up of m n k 1 × 1 cubes glued together and then asked you how many of such cubes are touched by the inner diagonal. How would you go about solving that?
Log in to reply
I believe the answer is, by PIE, m + n + k − g cd ( m , n ) − g cd ( m , k ) − g cd ( n , k ) + g cd ( m , n , k )
Log in to reply
Yes indeed. In fact if I am correct, this problem can be generalized into n dimensional space using the Principle of Inclusion and Exclusion, the answer being J ∈ { a 1 , a 2 , a 3 , . . . , a n } ; J = ϕ ∑ ( − 1 ) ∣ J ∣ + 1 g cd ( i f o r i ϵ J ) ), where the man starts from the origin and goes to the point ( a 1 , a 2 , . . . , a n ) .
Let's assume the man travels from the lattice point ( 1 8 , 5 7 ) to the origin in two-dimensional Euclidean space, where each unit square represents a county. After the man has visited the upper right county, he will still have to visit 1 7 counties to his left and 5 6 counties below him. Also, the man visits two lattice points on his way, by which he travels a square left and a square down while only visiting one new county, instead of two. So, the man visits a total of 1 + 1 7 + 5 6 − 2 = 7 2 counties.
Now, let M n denote the amount of money the man spends in the n -th county. We know that
M n = − 4 ( M n − 1 + M n − 2 ) ,
for all integers n ≥ 3 . Let's prove by induction that
M n = ( − 1 ) n ⋅ ( 2 n − 3 ) ⋅ 2 n − 1 ,
for all positive integers n . The base cases M 1 = 1 and M 2 = 2 are true. Let's assume that it is true for some positive integers k − 1 , k − 2 with k ≥ 3 . Then
M k = − 4 ( M k − 1 + M k − 2 ) = − 4 ( ( ( − 1 ) k − 1 ⋅ ( 2 k − 5 ) ⋅ 2 k − 2 ) + ( ( − 1 ) k − 2 ⋅ ( 2 k − 7 ) ⋅ 2 k − 3 ) ) = − 4 ⋅ ( − 1 ) k − 2 ⋅ 2 k − 3 ⋅ ( ( − 1 ⋅ ( 2 k − 5 ) ⋅ 2 ) + ( 2 k − 7 ) ) = ( − 1 ) 2 2 ⋅ ( − 1 ) k − 2 ⋅ 2 k − 3 ⋅ ( − 1 ) ( 2 k − 3 ) = ( − 1 ) k ⋅ ( 2 k − 3 ) ⋅ 2 k − 1 ,
which is what we wanted. So, the amount of money the man spends in the last county is
M 7 2 = ( − 1 ) 7 2 ⋅ ( 2 ( 7 2 ) − 3 ) ⋅ 2 7 2 − 1 = 1 4 1 ⋅ 2 7 1 ,
so
a + b = 1 4 1 + 7 1 = 2 1 2 .
We will divide this problem into two sections. In the first section, we have to find the number of counties the man passes through, and in the second section, we will find a general pattern for the amount of money in the n t h county.
For the first section, we note that the greatest common divisor of 1 8 and 5 7 is 3 . Thus the rectangle can be further divided into 9 smaller rectangles, each of size 6 × 1 9 (by dividing each side into three). The man's path will cut through the corners of exactly 3 of the 6 × 1 9 rectangles.
Now, we will prove that for an m × n rectangle with g c d ( m , n ) = 1 , the number of counties the man passes through when he traverses the diagonal will be m + n − 1 . Indeed, the borders of the counties comprise m + 1 vertical lines and n + 1 horizontal lines. As the man traverses the diagonal, the number of vertical lines he crosses is m − 1 and the number of horizontal lines he crosses is n − 1 , because he does not cross the 2 lines at the extremes. Starting from the top corner (the first county), each time he crosses a line, he enters a new county. Because he crosses m + n − 2 lines, the total number of counties he visits will be 1 + ( m + n − 2 ) = m + n − 1 .
Thus for a 6 × 1 9 rectangle, the man will cross 6 + 1 9 − 1 = 2 4 counties. He crosses exactly 3 such rectangles, so the total number of counties he visits is 2 4 × 3 = 7 2 .
We proceed to the second section, to find the general pattern for the amount spent in the n t h county. Let A n be the amount spent in the n t h county. We calculated the first few amounts and get: A 1 = 1 , A 2 = 2 , A 3 = − 1 2 , A 4 = 4 0 , A 5 = − 1 1 2 , A 6 = 2 8 8
The question hints that the pattern will contain a 2 b term, so we quickly note that A 2 is divisible by 2 , A 3 is divisible by 4 , A 4 is divisible by 8 , A 5 is divisible by 1 6 , and A 6 is divisible by 3 2 . Furthermore,
2 A 2 = 1 , 4 A 3 = − 3 , 8 A 4 = 5 , 1 6 A 5 = − 7 , 3 2 A 6 = 9
Thus we arrive at a conjecture: 2 n − 1 ∣ A n ∣ = 2 n − 3 or ∣ A n ∣ = ( 2 n − 1 ) ( 2 n − 3 )
You can prove this using mathematical induction.
Now the answer is simple. At the 7 2 t h county, the absolute value of the amount spent is ( 2 7 2 − 1 ) ( 2 × 7 2 − 3 ) = 2 7 1 × 1 4 1 .
Therefore a + b = 7 1 + 1 4 1 = 2 1 2
Label the grid in Cartesian coordinates. Note that (by symmetry) the problem is not changed if the man goes from the bottom left corner to the top right corner instead (I chose this interpretation so that the co-ordinates of the intersections of the counties were positive; this was not necessary at all). Let the starting point of the man be labelled ( 0 , 0 ) . Then, the coordinates of the ending point are ( 1 8 , 5 7 ) [assuming that the horizontal length of the grid is 1 8 ; by symmetry the scenario does not change if the grid is flipped by 9 0 ∘ ]. The equation of the path of the man is then y = 1 8 5 7 x = 6 1 9 x , 1 ≤ x ≤ 1 8 (consequently 1 ≤ y ≤ 5 7 ). Then, note that the lattice points on the path will be ( 6 , 1 9 ) , ( 1 2 , 3 8 ) , and ( 1 8 , 5 7 ) (a lattice point is a point whose coordinates are integers; note that g cd ( 1 9 , 6 ) = 1 , so for a point to be a lattice point, its x coordinate has to be a multiple of 6 ). Now, for the man to go from the bottom left corner to the top right corner, he has to cross every straight line parallel to either the x axis or the y axis. Call a straight line good if it is parallel to either the x axis or the y axis, its distance from both the axes is positive, and it connects the lattice points. Then, the man will go from one county to another if and only if he crosses a good line. Conversely, if a man crosses a good line, he shifts from the county he is in to another county. So, for the man to travel from the bottom left to the top right, he has to cross all good lines located within the grid. The total number of good lines located within the grid are 5 7 + 1 8 = 7 5 . So we can conclude that the man has gone through 7 5 counties in total. However, we have double counted certain cases. When a man passes through a lattice point, he passes through two good lines at once (the converse is also true). As mentioned previously, there are a total of 3 lattice points on the man's path, so 3 counties have been double counted. Subtracting this number, we find out that the man has gone through 7 5 − 3 = 7 2 counties in all.
Now let a n be the sequence defined by a n + 2 = − 4 ( a n + 1 + a n ) for all n ≥ 3 , a 1 = 1 , and a 2 = 2 . We simply wish to determine a 7 2 . Note that the characteristic equation of the recurrence relation is x 2 − 4 x − 4 = 0 , which has only 1 distinct root:- x = − 2 . Hence we can conclude that the closed form for this relation will be a n = c 1 ( − 2 ) n + c 2 n ( − 2 ) n , where c 1 and c 2 are constants (see link provided). Plugging a 1 = 1 and a 2 = 2 , we get a system of linear equations which has solution ( c 1 , c 2 ) = ( − 2 3 , 1 ) . Therefore we get the closed form a n = − 2 3 ( − 2 ) n + n ( − 2 ) n .
Then, a 7 2 = − 2 3 ( − 2 ) 7 2 + 7 2 ( − 2 ) 7 2 = 1 4 1 . 2 7 1 . Thus, a = 1 4 1 , b = 7 1 , and a + b = 1 4 1 + 7 1 = 2 1 2 (note that the representation of a number in the form ( 2 m + 1 ) 2 n is unique).
Correction :- The characteristic equation of the recurrence relation is x 2 + 4 x + 4 = 0 .
First, we count the number of counties the man goes through. Let us consider a general case of a x by y plot. To get from the top-right to the bottom-left, he has to go down y − 1 squares and over x − 1 squares. Including the first square, that is x + y − 1 squares. However, he may go down a square and over a square at the same time. This will happen g cd ( x , y ) − 1 times, and each time it happens, he goes through one less county than he would usually go through. We had x + y − 1 , and subtracting g cd ( x , y ) − 1 , we have the total number of squares he goes through, x + y − g cd ( x , y ) . Applying this to our 18 by 57 plot, we find he goes through 1 8 + 5 7 − 3 = 7 2 squares.
Now, we find the amount he pays in the n th county, a n . In the third, he spends − 1 2 dollars. By induction, we will show that a n = ( − 1 ) n ⋅ 2 n − 1 ⋅ ( 2 n − 3 ) for all positive integers n > 1 . For n = 2 , 3 , the equation is clearly satisfied. For n = k , we have − 4 ⋅ ( ( − 1 ) k − 2 ⋅ 2 k − 3 ⋅ ( 2 k − 7 ) + ( − 1 ) k − 1 ⋅ 2 k − 2 ⋅ ( 2 k − 5 ) ) = − 4 ⋅ ( − 1 ) k − 1 ⋅ 2 k − 3 ⋅ ( 2 ( 2 k − 5 ) − ( 2 k − 7 ) ) = ( − 1 ) k ⋅ 2 k − 1 ⋅ ( 2 k − 3 ) Our induction is complete.
Finally, the amount spent in the last square is 2 7 1 ( 1 4 1 ) , and the answer is 7 1 + 1 4 1 = 2 1 2 .
Surprisingly,
a n = ( − 1 ) n ⋅ 2 n − 1 ⋅ ( 2 n − 3 )
also holds for n = 1 .
Log in to reply
That's not surprising as a n + 2 + 4 a n + 1 + 4 a n = 0 is a linear recurrence relation. This has a characteristic polynomial of λ 2 + 4 λ + 4 , which has a double root of λ = − 2 . So, the general form will be a n = ( A n + B ) ⋅ ( − 2 ) n for some constants A , B which depend on initial conditions.
Log in to reply
I know it makes sense, but when solving the problem, it at first seems as if it only holds for n ≥ 2 , because A 1 and A 2 are both positive, and after that it flips signs (which is what ( − 1 ) n does). It does hold for n = 1 because 2 n − 3 then suddenly becomes negative (canceling out the − 1 ), which is why I said 'surprisingly'.
Log in to reply
@Tim Vermeulen – You used n = 1 and n = 2 as your base cases, so it should not be that surprising for you. :)
And n = 2 .
Problem Loading...
Note Loading...
Set Loading...
We first attempt to find an explicit formula that corresponds to how much the man (let's call him Bob) spends in the n th county.
Let a n denote the amount that Bob spent in the n th county he walked through, letting the first county correspond to n = 0 . We easily calculate and list the first few terms in the sequence: a 0 = 1 = 1 ⋅ 2 0 , a 1 = 2 = 1 ⋅ 2 1 , a 2 = − 1 2 = ( − 1 ) 2 − 1 ⋅ 3 ⋅ 2 2 , a 3 = 4 0 = ( − 1 ) 3 − 1 ⋅ 5 ⋅ 2 3 , . . . .
It seems as though a n = ( − 1 ) n − 1 ⋅ ( 2 n − 1 ) ⋅ 2 n for n ≥ 1 . Let's see if this is the case: a n + 2 = − 4 ( a n + 1 + a n ) = − 4 ( ( − 1 ) n ⋅ ( 2 n + 1 ) ⋅ 2 n + 1 + ( − 1 ) n − 1 ⋅ ( 2 n − 1 ) ⋅ 2 n ) = − 4 ( ( − 1 ) n ⋅ 2 n ⋅ ( ( 4 n + 2 ) − ( 2 n − 1 ) ) ) = ( − 1 ) ( n + 2 ) − 1 ⋅ ( 2 ( n + 2 ) − 1 ) ⋅ 2 n + 2 ✓ . This relation means that we've found an explicit formula for how much Bob spends in each county.
Now we need to find how many counties Bob walks through on his way through the plot of land. It is well-known that the diagonal line through a rectangle with side lengths c , d ∈ Z + will cross through c + d − g cd ( c , d ) unit squares, which means that Bob will walk through 1 8 + 5 7 − g cd ( 1 8 , 5 7 ) = 7 2 squares (or counties, in this problem).
This can be easily verified. In order to travel 5 7 miles south and 1 8 miles west in a straight line, Bob will walk across 5 6 horizontal lines and 1 7 vertical lines which mark the borders of the counties. Each time Bob walks across a border, he enters a new county, and so the total number of counties he walks through "should" be 5 6 + 1 7 . However, this does not account for the fact that Bob sometimes walks across two borders at once (he walks across the corner of a county directly to a diagonally adjacent county). This clearly happens two times, since we do not care about the bottom-left corner. Finally, we need to account for the county which Bob begins in (the top-right one). Therefore, our total becomes 5 6 + 1 7 − 2 + 1 = 5 7 + 1 8 − g cd ( 1 8 , 5 7 ) = 7 2 , as expected.
We now know that we want to find was a 7 1 is (remember that we called the first county "county 0"). Using the explicit formula we found above, we get that a 7 1 = ( − 1 ) 7 1 − 1 ⋅ ( 2 ⋅ 7 1 − 1 ) ⋅ 2 7 1 = 1 4 1 ⋅ 2 7 1 . Thus, we have a = 1 4 1 , b = 7 1 , and so our answer is 1 4 1 + 7 2 = 2 1 2 .
Note: For more information on the theorem about diagonals and square grids seen above, visit this website .