<?xml version="1.0" encoding="UTF-8" ?>
  <resource>
  <id>7331</id>
  <path>/www/nrich/html/content/id/7331/</path>
  <resourceTypeID>1</resourceTypeID>
  <last_published>2011-02-01T00:00:01</last_published>
  <indexXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;ul id=&quot;stemLinks&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://nrich.maths.org/5918&quot;&gt;Warm-up&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://nrich.maths.org/5974&quot;&gt;Try this next&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://nrich.maths.org/5928&quot;&gt;Think higher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://plus.maths.org/content/os/issue36/features/nishiyama/index&quot;&gt;Read: mathematics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://nrich.maths.org/6025&quot;&gt;Read: technology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://plus.maths.org/content/brain&quot;&gt;Explore further&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt; &lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;p&gt;What does this procedure do? Prove it.&lt;br&gt;&lt;/br&gt;
 &lt;br&gt;&lt;/br&gt;
 &lt;mdo:image alt=&quot;&quot; height=&quot;674&quot; src=&quot;procedure.png&quot; width=&quot;483&quot;&gt;&lt;/mdo:image&gt;&lt;/p&gt;&lt;/mdoxml&gt;</indexXML>
  <solutionXML/>
  <noteXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;It is not envisaged that &lt;a href=&quot;http://nrich.maths.org/7331&quot;&gt;this problem&lt;/a&gt; would be used as a class problem.  It is more appropriate for an enthusiastic student or small group of students looking for a challenge to work on independently.&lt;/mdoxml&gt;</noteXML>
  <clueXML/>
  <canonXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;
&lt;p&gt;This procedure calculates the highest common factor of A and B. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The algorithm swaps over A and B to ensure A &amp;gt; B. We know hcf(A,B) $\leq$ min(A,B) = B in this case. Therefore, the first guess for N = hcf(A,B) is B. It first tests whether N is a factor of B. If that&amp;#39;s the case, it then tests whether it&amp;#39;s a factor of A. If either of these fail, it decreases N by 1. Eventually, it will either stop at a value of N&amp;gt;1 such that N divides A and B, or will
terminate when N=1 (as A/1 and B/1 are both whole numbers). In the latter case, A and B are coprime. &lt;/p&gt;

&lt;/mdoxml&gt;</canonXML>
  <end_user_role>2</end_user_role>
  <difficulty>3</difficulty>
  <keystage1>0</keystage1>
  <keystage2>0</keystage2>
  <keystage3>0</keystage3>
  <keystage4>1</keystage4>
  <keystage4plus>0</keystage4plus>
  <title>Mystery Procedure</title>
  <description>Can you work out what this procedure is doing?</description>
  <spec_group>Applications
    <specifier>engineering</specifier>
  </spec_group>
  <spec_group>Applications
    <specifier>Technology</specifier>
  </spec_group>
  <spec_group>Admin
    <specifier>Individual</specifier>
  </spec_group>
  <spec_group>Information and Communications Technology
    <specifier>Programming</specifier>
  </spec_group>
  <spec_group>Applications
    <specifier>Maths Supporting SET</specifier>
  </spec_group>
  <spec_group>Admin
    <specifier>Stage 5 Decision mapping</specifier>
  </spec_group>
  <spec_group>Applications
    <specifier>STEM - design technology</specifier>
  </spec_group>
  <spec_group>Admin
    <specifier>No Teachers Notes</specifier>
  </spec_group>
</resource>