Day 6: A Fun Game

A mathematician writes the integers 1 , 2 , 3 , 4 , , 2015 1,2,3,4,\ldots,2015 on a whiteboard, with which he plays a game.

Every turn he selects two numbers a a and b b that are on the whiteboard, subject to two conditions:

  • If one of a a and b b are prime, he will always let a a be prime; so if he picks 5 and 8, then he will let a = 5 , b = 8 a = 5, b= 8 .
  • But if both are prime, or both are not prime, then a b a \leq b

Then he rubs off a a and b b and replaces them with a 2 b + 2 a 4 b 2 a^2b+2a-4b-2 .

He continues this process until one number is left on the whiteboard.

What number is this?

Note : By primes I do only mean positive primes only.


This problem is part of the Advent Calendar 2015 .


The answer is 2.

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.

4 solutions

Michael Ng
Dec 5, 2015

From experimenting you might find that when one of the numbers is 2 2 , the expression always becomes 2 2 .

Indeed, when the other number is not prime, then a = 2 a = 2 and when the other number is prime, then a = 2 a=2 since it is the smallest prime number.

Now when a = 2 a=2 , a 2 b + 2 a 4 b 2 = ( 2 2 4 ) b + 4 2 = 0 + 2 = 2 a^2b+2a-4b-2 = (2^2-4)b + 4 - 2 = 0 + 2 = 2 . So at any stage the number 2 2 must be present as there is no way of getting rid of it; it is an invariant . Therefore the answer must be 2 2 .

Yes Same way

Kushagra Sahni - 5 years, 6 months ago

Log in to reply

Thank you, well done!

Michael Ng - 5 years, 6 months ago
Mark Hennings
Dec 9, 2015

This problem is not quite correct, I think; it is possible to lose the number 2 2 , since the rule permits the introduction of negative numbers.

If our hero first picks 1 1 and 9 9 then, since neither of these numbers are prime, he chooses a = 1 a=1 and b = 9 b=9 , and these two numbers are replaced by 27 -27 .

If he now picks 3 3 and 27 -27 then, since 3 3 is prime while 27 -27 is not, he chooses a = 3 a=3 and b = 27 b=-27 , and so these two numbers are replaced by 131 -131 , which is prime (its only divisors are associates of 131 131 and units).

If he now picks 2 2 and 131 -131 , then both are prime, so he chooses a = 131 a=-131 and b = 2 b=2 , and we lose the number 2 2 , since these two numbers are now replaced by 34050 34050 .

We can fix this problem by redefining the replacement number to be a 2 b + 2 a 4 b + 2 |a^2b + 2a - 4b + 2| , because then numbers are always positive, and the above problem never arises (since 2 2 is then the smallest possible prime that can occur).

Prime numbers cannot be negative as they are all natural numbers by (the commonly accepted) definitions. (You are rather referring to more general concepts, e.g prime elements of the ring Z of integers.)

Zee Ell - 5 years, 6 months ago

Log in to reply

The rules considers whether a a and b b are "prime", and not whether they are (positive) "prime numbers". The standard conventions define what are called "prime numbers" as being positive; they do not redefine the meaning of the adjective "prime" (which has a precise mathematical connotation), save in casual usage.

Without clarification in the question, my objection stands.

Mark Hennings - 5 years, 6 months ago

Log in to reply

In this case the best course of action could be to reply Michael Ng, give him the "precise mathematical connotation" regarding "prime" you mentioned and ask him to either change the wording from "prime" to "(positive) prime number" or use the absolute value at the replacement number as you originally suggested.

Zee Ell - 5 years, 6 months ago

Log in to reply

@Zee Ell Thank you for your replies by the way :)

Michael Ng - 5 years, 6 months ago

Hi Mark; I did think of this at first (I have done some ring theory and I do know that there are negative primes) but I had thought that the context made it clear enough (most people will not think of negative primes (except the more serious mathematicians)). Furthermore it is clear that there is no valid answer if we do consider negative primes. However you have certainly raised a good point so I will add a clarification to the problem soon :)

Michael Ng - 5 years, 6 months ago

Log in to reply

I totally agree that, if there is to be a unique answer, then only positive primes should be considered. However, solving a problem with the strategy of "since it is not clear, I will interpret it in the only way that gives me a solution, and presume that was what was meant" may be the way to handle a typo in an examination question (indeed, it was how I came up with your answer of 2 2 ), but it does not mean that the question was correctly stated. People on Brilliant are, I am sure, serious about their mathematics. For a Level 5 question, a little knowledge of Ring Theory might be presumed.

There are at least three ways of making your problem clear. You could specify that you mean positive primes. You could put moduli signs around your formula, to ensure that all replacement numbers are positive. Or you could add a rule which insists that, whenever 1 1 is one of the chosen numbers, then b = 1 b=1 . That also ensures that negative numbers never arise, and therefore that the issue about negative primes never occurs.

Mark Hennings - 5 years, 6 months ago

Log in to reply

Thank you; I have added a clarification at the bottom (in fact I had originally set this as a Level 3 but of course I was tired and obviously made an incorrect decision indeed ;) )

Michael Ng - 5 years, 6 months ago
Zee Ell
Dec 7, 2015

a 2 b + 2 a 4 b 2 = ( a 2 4 ) b + 2 ( a 2 ) + 2 = ( a 2 ) ( ( a + 2 ) b + 2 ) + 2 a^2b+2a-4b-2=(a^2-4)b+2(a-2)+2=(a-2)((a+2)b+2)+2

Since 2 is the smallest prime number, therefore, if we have 2 and any other number (b), then a=2, according to the rules of the game.

As we can see from the expression above, its value is always 2 (independent of the value of b) when a=2 (then (a-2)=0, therefore the first part (product)=0 as it has a 0 factor, 0+2=2).

Therefore, 2 will always remain on the table. Since the rules of the game ensure that we will have one value less on the table after each step (as we write one value instead of two until only one remains), the last number has to be 2.

Siddharth Yadav
Mar 11, 2017

I did it this way . Since the numbers are replaced by some other number using the expression given in the problem . So clearly just one output will be there once the saturation point arrives(I.e. a=b) . (a^2)b +2a-4b-2 becomes (a^3)-2a-2 And now this is equal to a (as on plugging a number into the expression , the same number is yielded) So a cubic polynomial results with roots as 2 ,-1,-1. So answer is 2

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...