Difference between revisions of "2007 iTest Problems/Problem 54"

(Created page with "== Problem == Let <math>T=\text{TNFTPP}</math>. Consider the sequence <math>(1, 2007)</math>. Inserting the difference between <math>1</math> and <math>2007</math> between them,...")
 
(Solution to Problem 54 — long and tough sequence problem)
 
Line 1: Line 1:
== Problem ==
+
''The following problem is from the Ultimate Question of the [[2007 iTest]], where solving this problem required the answer of a previous problem.  When the problem is rewritten, the T-value is substituted.''
  
Let <math>T=\text{TNFTPP}</math>. Consider the sequence <math>(1, 2007)</math>. Inserting the difference between <math>1</math> and <math>2007</math> between them, we get the sequence <math>(1, 2006, 2007)</math>. Repeating the process of inserting differences between numbers, we get the sequence <math>(1, 2005, 2006, 1, 2007)</math>. A third iteration of this process results in <math>(1, 2004, 2005, 1, 2006, 2005, 1, 2006, 2007)</math>. A total of <math>2007</math> iterations produces a sequence with <math>2^{2007}+1</math> terms. If the integer <math>4T</math> (that is, <math>4</math> times the integer <math>T</math>) appears a total of <math>N</math> times among these <math>2^{2007}+1</math> terms, find the remainder when <math>N</math> gets divided by <math>2007</math>.
+
==Problem==
  
== Solution ==
+
Consider the sequence <math>(1, 2007)</math>. Inserting the difference between <math>1</math> and <math>2007</math> between them, we get the sequence <math>(1, 2006, 2007)</math>. Repeating the process of inserting differences between numbers, we get the sequence <math>(1, 2005, 2006, 1, 2007)</math>. A third iteration of this process results in <math>(1, 2004, 2005, 1, 2006, 2005, 1, 2006, 2007)</math>. A total of <math>2007</math> iterations produces a sequence with <math>2^{2007}+1</math> terms. If the integer <math>2004</math> appears a total of <math>N</math> times among these <math>2^{2007}+1</math> terms, find the remainder when <math>N</math> gets divided by <math>2007</math>.
 +
 
 +
==Solution==
 +
 
 +
Consider the number of times a certain number appears, and consider the lowest number in each iteration.  Since <math>2007</math> is the largest number of the sequence, it will appear only one time no matter how many iterations occurred.  Also, in the part <math>1</math>, <math>2007</math> (last two terms of sequence), one iteration results in <math>1</math>,<math>2006</math>,<math>2007</math>, and another results in <math>1</math>,<math>2005</math>,<math>2006</math>,<math>1</math>,<math>2007</math>.
 +
 
 +
Let <math>n</math> be a positive integer less than <math>2007</math> but more than <math>0</math>.  Assume that part of the sequence is <math>1</math>, <math>n</math>, <math>n+1</math>, <math>1</math> (note that reversing sequence won’t change proof).  After an iteration, one of the parts of the sequence will be <math>1</math>, <math>n-1</math>, <math>n</math>, <math>1</math>, <math>n+1</math>, <math>n</math>, <math>1</math>.  This means that each iteration produces numbers that are less than <math>n+1</math>, and each number more than <math>2</math> will be next to <math>1</math> and a consecutive number.  Also, each number will have a number one lower and <math>1</math> next to the original after an iteration.
 +
 
 +
Finally, to count the number of times <math>2006</math> appears in a sequence, note that another one only appears if the previous iteration has a <math>1</math> next to a <math>2007</math>.  With this in mind, we can make a table that indicates the number of times a term appears in a sequence.  Let <math>a_n</math> be the number of times <math>2007</math> appears, <math>b_n</math> be the number of times <math>2006</math> appears, <math>c_n</math> be the number of times <math>2005</math> appears, and <math>d_n</math> be the number of times <math>2004</math> appears, where <math>n</math> is the number of iterations that happened.
 +
 
 +
{|class="wikitable" style="margin-left: auto; margin-right: auto;"
 +
|-
 +
|Number of iterations
 +
|<math>a_n</math>
 +
|<math>b_n</math>
 +
|<math>c_n</math>
 +
|<math>d_n</math>
 +
|-
 +
|1
 +
|1
 +
|1
 +
|0
 +
|0
 +
|-
 +
|2
 +
|1
 +
|1
 +
|1
 +
|0
 +
|-
 +
|3
 +
|1
 +
|2
 +
|2
 +
|1
 +
|-
 +
|4
 +
|1
 +
|2
 +
|4
 +
|3
 +
|-
 +
|5
 +
|1
 +
|3
 +
|6
 +
|7
 +
|-
 +
|6
 +
|1
 +
|3
 +
|9
 +
|13
 +
|-
 +
|7
 +
|1
 +
|4
 +
|12
 +
|22
 +
|-
 +
|8
 +
|1
 +
|4
 +
|16
 +
|34
 +
|-
 +
|9
 +
|1
 +
|5
 +
|20
 +
|50
 +
|-
 +
|10
 +
|1
 +
|5
 +
|25
 +
|70
 +
|}
 +
 
 +
Notice that when <math>n</math> is odd, <math>d_{n}</math> will result in a sequence that has a common third difference, so we can write a cubic function.  Let <math>x = \tfrac{n+1}{2}</math>, so the wanted points <math>(x,d_{n})</math> are <math>(1,0)</math>, <math>(2,1)</math>, <math>(3,7)</math>, and <math>(4,22)</math>.
 +
 
 +
If the given cubic is <math>ax^3 + bx^2 + cx + d</math>, then
 +
<cmath>a+b+c+d = 0</cmath>
 +
<cmath>8a+4b+2c+d = 1</cmath>
 +
<cmath>27a + 9b + 3c + d = 7</cmath>
 +
<cmath>64a + 16b + 4c + d = 22</cmath>
 +
Solving the system results in <math>a = \tfrac46</math>, <math>b = -\tfrac96</math>, <math>c = \tfrac56</math>, and <math>d = 0</math>, so the cubic is
 +
<cmath>\frac{4x^3 - 9x^2 + 5x}{6}</cmath>
 +
<cmath>\frac{x(4x-5)(x-1)}{6}</cmath>
 +
If <math>n = 2007</math>, then <math>x = 1004</math>, so <math>d_{2007}</math> equals
 +
<cmath>\frac{1004 \cdot 4011 \cdot 1003}{6}</cmath>
 +
<cmath>502 \cdot 1337 \cdot 1003</cmath>
 +
Thus, <math>N = 673187522</math>, and the remainder when <math>N</math> is divided by <math>2007</math> is <math>\boxed{1589}</math>.
 +
 
 +
==See Also==
 +
{{iTest box|year=2007|num-b=53|num-a=55}}
 +
 
 +
[[Category:Olympiad Algebra Problems]]

Latest revision as of 19:07, 27 July 2018

The following problem is from the Ultimate Question of the 2007 iTest, where solving this problem required the answer of a previous problem. When the problem is rewritten, the T-value is substituted.

Problem

Consider the sequence $(1, 2007)$. Inserting the difference between $1$ and $2007$ between them, we get the sequence $(1, 2006, 2007)$. Repeating the process of inserting differences between numbers, we get the sequence $(1, 2005, 2006, 1, 2007)$. A third iteration of this process results in $(1, 2004, 2005, 1, 2006, 2005, 1, 2006, 2007)$. A total of $2007$ iterations produces a sequence with $2^{2007}+1$ terms. If the integer $2004$ appears a total of $N$ times among these $2^{2007}+1$ terms, find the remainder when $N$ gets divided by $2007$.

Solution

Consider the number of times a certain number appears, and consider the lowest number in each iteration. Since $2007$ is the largest number of the sequence, it will appear only one time no matter how many iterations occurred. Also, in the part $1$, $2007$ (last two terms of sequence), one iteration results in $1$,$2006$,$2007$, and another results in $1$,$2005$,$2006$,$1$,$2007$.

Let $n$ be a positive integer less than $2007$ but more than $0$. Assume that part of the sequence is $1$, $n$, $n+1$, $1$ (note that reversing sequence won’t change proof). After an iteration, one of the parts of the sequence will be $1$, $n-1$, $n$, $1$, $n+1$, $n$, $1$. This means that each iteration produces numbers that are less than $n+1$, and each number more than $2$ will be next to $1$ and a consecutive number. Also, each number will have a number one lower and $1$ next to the original after an iteration.

Finally, to count the number of times $2006$ appears in a sequence, note that another one only appears if the previous iteration has a $1$ next to a $2007$. With this in mind, we can make a table that indicates the number of times a term appears in a sequence. Let $a_n$ be the number of times $2007$ appears, $b_n$ be the number of times $2006$ appears, $c_n$ be the number of times $2005$ appears, and $d_n$ be the number of times $2004$ appears, where $n$ is the number of iterations that happened.

Number of iterations $a_n$ $b_n$ $c_n$ $d_n$
1 1 1 0 0
2 1 1 1 0
3 1 2 2 1
4 1 2 4 3
5 1 3 6 7
6 1 3 9 13
7 1 4 12 22
8 1 4 16 34
9 1 5 20 50
10 1 5 25 70

Notice that when $n$ is odd, $d_{n}$ will result in a sequence that has a common third difference, so we can write a cubic function. Let $x = \tfrac{n+1}{2}$, so the wanted points $(x,d_{n})$ are $(1,0)$, $(2,1)$, $(3,7)$, and $(4,22)$.

If the given cubic is $ax^3 + bx^2 + cx + d$, then \[a+b+c+d = 0\] \[8a+4b+2c+d = 1\] \[27a + 9b + 3c + d = 7\] \[64a + 16b + 4c + d = 22\] Solving the system results in $a = \tfrac46$, $b = -\tfrac96$, $c = \tfrac56$, and $d = 0$, so the cubic is \[\frac{4x^3 - 9x^2 + 5x}{6}\] \[\frac{x(4x-5)(x-1)}{6}\] If $n = 2007$, then $x = 1004$, so $d_{2007}$ equals \[\frac{1004 \cdot 4011 \cdot 1003}{6}\] \[502 \cdot 1337 \cdot 1003\] Thus, $N = 673187522$, and the remainder when $N$ is divided by $2007$ is $\boxed{1589}$.

See Also

2007 iTest (Problems, Answer Key)
Preceded by:
Problem 53
Followed by:
Problem 55
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 TB1 TB2 TB3 TB4