<?xml version="1.0" encoding="ISO-8859-1" ?>
  <resource>
  <id>279</id>
  <path>/www/nrich/html/content/99/09/15plus3/</path>
  <resourceTypeID>1</resourceTypeID>
  <last_published>2011-02-01T00:00:01</last_published>
  <indexXML>&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;br&gt;&lt;/br&gt;
&lt;p&gt;My phone number has seven digits: if the last four digits are placed in front of the remaining three you get one more than twice my number! What is the number?&lt;/p&gt;
&lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</indexXML>
  <solutionXML>&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;br&gt;&lt;/br&gt;

&lt;p&gt;Two excellent solutions follow, one from Elizabeth Whitmore of
Madras College, St Andrew's, which uses Euclid's algorithm and the
other, which uses a computer program, from Serguey and Ilya from
the International School of The Hague. First Serguey and Ilya's
solution.&lt;/p&gt;
&lt;p&gt;Let $x$ be the three digit number at the start.&lt;/p&gt;
&lt;p&gt;Let $y$ be the four digit number at the end of the phone
number.&lt;/p&gt;
&lt;p&gt;The original phone number is $10000x + y$. The changed phone
number is $1000y + x$.&lt;/p&gt;
&lt;p&gt;The new number is one more than the old number doubled so
$$20000x + 2y + 1 = 1000y + x$$ $$19999x + 1 = 998y.$$ There are an
infinite number of solutions to this equation.&lt;/p&gt;
&lt;p&gt;We wrote the following program to test integer solutions:&lt;/p&gt;
&lt;pre&gt;
 
 &lt;code&gt;Module1 - 1
 

 
   Sub bbbbbbb ()
 

 
   y = 2004
 

 
   For x = 100 to 999
 

 
   y = (19999 * x + 1) / 998
 

 
   If y = Int(y) Then Debug.Print x; y
 

 
   Next x
 

 
   End Sub
 
&lt;/code&gt;

 
&lt;/pre&gt;
&lt;p&gt;The answer is: 435 8717&lt;br&gt;&lt;/br&gt;
Elizabeth solved this equation $$998y-19999x = 1$$ using Euclid's
algorithm, as follows:&lt;/p&gt;
&lt;div class=&quot;math&quot;&gt;\begin{eqnarray} \\ {\bf 19,999} &amp;amp;=&amp;amp;
998\times 20 + 39\\ \mathbf{998} &amp;amp;=&amp;amp; \mathbf{39}\times 25 +
23\\ \mathbf{39} &amp;amp;=&amp;amp; \mathbf{23}\times 1 + 16\\ \mathbf{23}
&amp;amp;=&amp;amp; \mathbf{16}\times 1 + 7\\ \mathbf{16} &amp;amp;=&amp;amp;
\mathbf{7}\times 2 + 2\\ \mathbf{7} &amp;amp;=&amp;amp; \mathbf{2}\times 3
+ 1\\ \mathbf{2} &amp;amp;=&amp;amp; \mathbf{1}\times 2 + 0.
\end{eqnarray}&lt;/div&gt;
&lt;p&gt;Working backwards to get values for $x$ and $y$:&lt;/p&gt;
&lt;div class=&quot;math&quot;&gt;\begin{eqnarray} 1 &amp;amp;=&amp;amp; {\bf 7}-3\times
{\bf 2}\\ &amp;amp;=&amp;amp; {\bf 7}-3\times ({\bf 16}-2\times {\bf 7})\\
&amp;amp;=&amp;amp; 7\times {\bf 7}-3\times {\bf 16}\\\ &amp;amp;=&amp;amp; 7\times
({\bf 23}-{\bf 16})-3\times {\bf 16}\\ &amp;amp;=&amp;amp; 7\times {\bf
23}-10\times {\bf 16}\\ &amp;amp;=&amp;amp; 7\times {\bf 23}-10\times ({\bf
39}-{\bf 23})\\ &amp;amp;=&amp;amp; 17\times {\bf 23}-10\times {\bf 39}\\
&amp;amp;=&amp;amp; 17\times ({\bf 998}-25\times {\bf 39})-10\times {\bf
39}\\ &amp;amp;=&amp;amp; 17\times {\bf 998}-435\times {\bf 39}\\
&amp;amp;=&amp;amp; 17\times {\bf 998}-435\times ({\bf 19999}-20\times {\bf
998})\\ &amp;amp;=&amp;amp; 8717\times {\bf 998}-435\times {\bf 19999}.
\end{eqnarray}&lt;/div&gt;
Thus $y=8717$ and $x= 435$. The old telephone number is therefore
4358717. Checking, we have $$8717435 = 1 + 2\times 4358717.$$
&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</solutionXML>
  <noteXML/>
  <clueXML>&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;p&gt;The original number is $10000x + y$. What is the new number in terms of $x$ and $y$? Use the information to write down a Diophantine equation.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://nrich.maths.org/public/viewer.php?obj_id=1357&amp;amp;part=index&quot;&gt;(The article on Euclid&amp;#39;s Algorithm might help with this problem.)&lt;/a&gt;&lt;/p&gt;&lt;/mdoxml&gt;</clueXML>
  <canonXML/>
  <end_user_role>2</end_user_role>
  <difficulty>4</difficulty>
  <keystage1>0</keystage1>
  <keystage2>0</keystage2>
  <keystage3>0</keystage3>
  <keystage4>0</keystage4>
  <keystage4plus>1</keystage4plus>
  <title>BT.. Eat your heart out</title>
  <description>If the last four digits of my phone number are placed in front of
the remaining three you get one more than twice my number! What is
it?</description>
  <spec_group>Calculations and Numerical Methods
    <specifier>Euclid's algorithm</specifier>
  </spec_group>
  <spec_group>Algebra
    <specifier>Diophantine equations</specifier>
  </spec_group>
  <spec_group>Admin
    <specifier>Long problems</specifier>
  </spec_group>
  <spec_group>Numbers and the Number System
    <specifier>Place value</specifier>
  </spec_group>
</resource>