<?xml version="1.0" encoding="UTF-8" ?>
  <resource>
  <id>7029</id>
  <path>/www/nrich/html/content/id/7029/</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;br&gt;&lt;/br&gt;
What does this black box do?&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
&lt;mdo:flash height=&quot;400&quot; width=&quot;550&quot;&gt;&lt;param value=&quot;/content/id/7029/BlackBox.swf&quot; name=&quot;movie&quot; &gt;&lt;/param&gt;&lt;param value=&quot;8&quot; name=&quot;flashplayerversion&quot; &gt;&lt;/param&gt;&lt;/mdo:flash&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</indexXML>
  <solutionXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;br&gt;&lt;/br&gt;
&lt;span class=&quot;editorial&quot;&gt;Well done to Patrick of Woodbridge School,
Ben, Lower 6 at Kingston Grammar, William of Bishop Wordsworth's
School and Herschel of the European School of Varese who all sent
in correct solutions to this very difficult problem, showing the
great tenacity and determination of the most mathematically minded!
We love the way the journeys, with their ups and downs, are
described in these solutions.&lt;/span&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
&lt;span class=&quot;editorial&quot;&gt;Before putting in the full solutions,
special mention must be given to Madeline aged 10 from St. Josephs
who discovered that the first function gave the prime numbers. She
said very clearly:&lt;/span&gt;&lt;br&gt;&lt;/br&gt;
 &lt;br&gt;&lt;/br&gt;
left numbers = y,  right numbers = x,  y = xth prime
number  &lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
&lt;span class=&quot;editorial&quot;&gt;This is how Lower 6 at Kingston Grammar
tackled the problem:&lt;/span&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
Function 1: First we looked for an algebraic solution. We tried
multiplicative and additive rules and a combination of both but
none worked. We quickly realised that this was not the case. Then
Freddie suspected that all the outputs were prime. So we tried
nearest prime to a multiple of the input but this didn't work
either. It became easier when we looked at the lower inputs. Then
Owen had an epiphany in a moment of pure inspiration that&lt;br&gt;&lt;/br&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;$f(x) =$ &lt;span style=&quot;font-style: italic;&quot;&gt;the $x^{th}$ prime&lt;/span&gt;!&lt;/div&gt;

&lt;div&gt;We had solved the puzzle in our class as a team.&lt;/div&gt;

&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
For function 2, we spent a while looking at the numbers generated
seeing nothing in particular except the fact that prime numbers
were always one less than themselves. This prompted us to look at
factors. After a long while thinking about factors and minusing
one, we looked at prime factors. This is when Andrew found the
rule.&lt;br&gt;&lt;/br&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;$f(x) = $ &lt;span style=&quot;font-style: italic;&quot;&gt;the product of all unique prime factors
each minus one multiplied by the other prime factors without
minusing one&lt;/span&gt;.&lt;/div&gt;

&lt;div&gt; &lt;/div&gt;

&lt;div&gt;For example, $60 \to 16$ since $60 = 2\times 2\times 3\times
5$ and therefore $(2-1)\times(3-1)\times(5-1)\times2=16$.&lt;/div&gt;

&lt;div&gt;$2,3,5$ are the unique factors reduced by one, then the $2$ is
multiplied without being reduced by one.&lt;/div&gt;

&lt;br&gt;&lt;/br&gt;
For function 3, we were again stumped for quite a while. We
realised in this case that there was a clearer relationship between
$x$ and $f(x)$. First we tried $y=mx+c$. This didn't work, so we
plotted a few points. Richard noticed that it looked a lot like the
graph of $y = ln x$. This reminded him of Gauss's approximation for
the distribution of the primes below any number. (Which was in fact
$x/(lnx)$.) It seemed to fit Gauss's formula pretty well and after
a few checks it was obvious that this was true. So $f(x)=$ number
of primes up to &lt;span style=&quot;font-style: italic;&quot;&gt;x&lt;/span&gt; .&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
 &lt;span class=&quot;editorial&quot;&gt;After deducing function 2, Herschel
remarked that &amp;quot;the business of only reducing each distinct factor
once was an evil trick!&amp;quot; Tricky it may have been but an evil trick
it is not. Patrick correctly identified this as Euler's totient
function which gives the number of numbers less than&lt;/span&gt; &lt;span class=&quot;editorial&quot; style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;editorial&quot;&gt;which are coprime to&lt;/span&gt; &lt;span class=&quot;editorial&quot; style=&quot;font-style: italic;&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;editorial&quot;&gt;. It is a particularly useful function especially
within public key cryptography.&lt;/span&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
 &lt;span class=&quot;editorial&quot;&gt;Ben worked out function 4 and 5 for
us:&lt;/span&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
Function 4: This one I didn't need to plot a graph for as I knew it
was going to be (kind of) about primes. So again I got a small
sample and looked at the primes that made up each value of &lt;span style=&quot;font-style: italic;&quot;&gt;x&lt;/span&gt; and looked for a pattern
between them and &lt;span style=&quot;font-style: italic;&quot;&gt;y&lt;/span&gt;. Very
quickly I noticed that y was the number of numbers that go into x
is divisible by. So I think that function 4 returns the number of
numbers that go into &lt;span style=&quot;font-style: italic;&quot;&gt;x&lt;/span&gt;
that are below or equal to &lt;span style=&quot;font-style: italic;&quot;&gt;x&lt;/span&gt;.&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
Function 5: Now this was a hard one but I managed to crack it. I
started off looking at the connection with primes again but this
went nowhere, and nor did plotting a graph, so I decided to try and
get the first 10 values (this took me ages!) as these are easier to
analyse than bigger numbers, and I still thought that it might have
something to do with primes. This function on the other hand has
nothing to do with primes, and the first 5 values of y are
$3,1,4,1,5$ which you can clearly see are the first 5 digits of pi
(well I could because I know the first 11 by heart $\ddot\smile$).
Checking this for larger values of &lt;span style=&quot;font-style: italic;&quot;&gt;x&lt;/span&gt; showed that it worked. It also
helped explain why each y value was only 1 digit in length. So
function 5 returns the $n^{th}$ digit of pi.&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
&lt;span class=&quot;editorial&quot;&gt;Patrick showed great persistance in his
solution:&lt;/span&gt;&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
Function 5: I soon found that $78$ appeared to be one of a very few
numbers outputting $0$. I consulted Wolfram|Alpha to investigate
properties of $78$, but nothing seemed to be obvious. It was a very
bizarre function; at one point, I thought the graph of $x$ against
$y$ was a message, since so many values overlapped. Given that all
the values were below $10$, I tried thinking of modular functions
to model this. The value $(1,3)$ was particularly problematic; $1$
mod anything is $1$. I spent about $30$ minutes on it, finding the
first $15$ values, before I read down the column: $3-4-5926535$
This is just the decimal places of pi, and is thus random. The
whole problem took me two hours, but I got there in the end!&lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</solutionXML>
  <noteXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;br&gt;&lt;/br&gt;
&lt;h3&gt;Why do this problem?&lt;/h3&gt;
&lt;a href=&quot;/7029&quot;&gt;This problem&lt;/a&gt; is best suited to tenacious problem solvers who will relish the intellectual challenge in making sense of the numbers. Although determining the function rules will be very challenging, on the technical side the mathematics required to verify the rules is elementary (KS3). Interestingly, the ideas raised will actually have relevance in university number theory and,
as such, could provide important insights for those going to university to study mathematics.
&lt;h3&gt;Possible approach&lt;/h3&gt;
&lt;div&gt;This challenge will require experimentation to gain sense of the numbers involved as, after a few trials, it will likely seem that there is little obvious pattern in the numbers produced.&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;div&gt;Part of the fun of this problem is to be faced with a straight &amp;#39;black box&amp;#39; and being left to decide how it works, so you may wish to hold back from offering hints to students.&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;div&gt;Once a feel for the numbers is found, students might start to make conjectures concerning the function rules which can then easily be tested: new examples will either add weight to the conjectures or cause them to be rejected. Students might need a spreadsheet or calculator to help in this regard. Alternatively, they could use the Wolfram Alpha computational knowledge engine
http://www.wolframalpha.com/.&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;div&gt;Once students have solved the problem they should write up their rules clearly to allow others to independently verify them. Of course, it is not possible to &lt;span style=&quot;font-style: italic;&quot;&gt;prove&lt;/span&gt; that the Black Box follows certain rules but, once discovered, evidence will soon build up in their favour.&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;div&gt;Finally, we don&amp;#39;t suggest using this task with students who are unlikely to enjoy this style of working: reserve it for very keen students who like individual challenges.&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;h3&gt;Key questions&lt;/h3&gt;
&lt;div&gt;What sorts of numbers does the problem involve?&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;div&gt;After a few trials, are you getting a feel for the sorts of numbers produced?&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;
&lt;div&gt;Do you have any rough ideas for how the numbers are related?&lt;/div&gt;
&lt;h3&gt;Possible extension&lt;/h3&gt;
&lt;div&gt;Students could read about the ideas raised. The links will be posted following the publication month for this problem&lt;/div&gt;
&lt;h3&gt;Possible support&lt;/h3&gt;
&lt;div&gt;Support questions will be posted following the publication month for this problem.&lt;/div&gt;
&lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</noteXML>
  <clueXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;&lt;br&gt;&lt;/br&gt;
Don't forget that a function is simply any rule which specifies a
set of given outputs for a set of given inputs. Functions don't
necessarily have to have a corresponding algebraic equation!&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;
As a hint, note that the function rules are actully rather easy to
state.&lt;br&gt;&lt;/br&gt;
&lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</clueXML>
  <canonXML>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;mdoxml version=&quot;1.0&quot;&gt;The functions are&lt;br&gt;&lt;/br&gt;
 &lt;br&gt;&lt;/br&gt;
1. nth Prime number $P(n)$&lt;br&gt;&lt;/br&gt;
2. $\Phi(n)$ (Euler's totient function) -- the number of numbers
less than n which are coprime to n. For example $\Phi(22) = 10,
\Phi(6) = 2$.&lt;br&gt;&lt;/br&gt;
3. Prime counting function $\Pi(n)$ -- the number of primes less
than or equal to $n$. For example, $\Pi(10)= 4, \Pi(23) = 9$.&lt;br&gt;&lt;/br&gt;
4. The number of divisors of the number. &lt;br&gt;&lt;/br&gt;
5. The nth digit of $\pi$. &lt;br&gt;&lt;/br&gt;&lt;/mdoxml&gt;</canonXML>
  <end_user_role>2</end_user_role>
  <difficulty>5</difficulty>
  <keystage1>0</keystage1>
  <keystage2>0</keystage2>
  <keystage3>0</keystage3>
  <keystage4>0</keystage4>
  <keystage4plus>1</keystage4plus>
  <title>Black box</title>
  <description>This black box reveals random values of some important, but
unusual, mathematical functions. Can you deduce the purpose of the
black box?</description>
  <spec_group>Using, Applying and Reasoning about Mathematics
    <specifier>Making and testing hypotheses</specifier>
  </spec_group>
  <spec_group>Numbers and the Number System
    <specifier>Number - generally</specifier>
  </spec_group>
  <spec_group>Numbers and the Number System
    <specifier>Prime numbers</specifier>
  </spec_group>
</resource>