At this year's state mental math competition, contestants will be given a prime number p<10,000 of the form 4k+1 and will be asked to find an integer x such that x²+1 is divisible by p, in less than 10 minutes. Each contestant will also be given access to two oracles:
Oracle 1: When given any integer n, outputs n².
Oracle 2: When given any integers m,n not divisible by p, outputs a number k such that kn-m is divisible by p. (In math-speak, this outputs m/n (mod p).)
Each oracle takes 1 second to respond.
You are going to enter this competition, but unfortunately, you are not great at mental math. In fact, all you know how to do in your head is add and subtract numbers. Furthermore, it takes you one second to perform such an operation.
Of course, you can also perform the most basic comparison operations in your head (m<n?, m>n?, m=n?). These also take you one second to perform.
Fortunately, you have a good short term memory, so you can keep track of and instantly access as many numbers in your head as you would like. Trying to fill your memory before the competition will be problematic, however, as your long term memory is bad.
How can you ensure success at this competition?
This is a quite nice problem, but without the rule of two squares is really difficult.
Anyway I think I'll be able most of the times in ten minutes with the established rules to find x, based the form of the succesives terms of n^2 on a p^2 field designes a certain figure. But I'm also sure I woudn't succeed in all the cases, as in the solution.
Posted by armando
on 2005-05-19 19:03:08