Skip to main content
OlympiadHQ

Browse · MathNet

Print

Mathematica competitions in Croatia

Croatia number theory

Problem

For a given prime number determine all integers such that is an integer.
Solution
Let , . Then . The solutions of this quadratic equation are The solutions are integers, so , for some . Since and , from , we obtain the following possibilities: In the first case we obtain , , so it follows: These numbers are integers only when is odd, i.e. only if .

In the second case we obtain , , so it follows that or and .
Final answer
For any prime p, the solutions are n = 0 and n = -p. If p is odd (p > 2), there are two additional solutions: n = ((p−1)/2)^2 and n = −((p+1)/2)^2.

Techniques

Prime numbersTechniques: modulo, size analysis, order analysis, inequalitiesQuadratic functions