Daily

Random

Practice set

Baltic Way 2018 · Problem 16

Number Theory

Let pp be an odd prime. Find all positive integers nn for which n2−np\sqrt{n^{2}-n p} is a positive integer.

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Diophantine equations · Divisibility and factorization · Primes

Solutions

Solution

Answer: n=(p+12)2n = \left(\frac{p+1}{2}\right)^2. Assume that n2−pn=m\sqrt{n^2 - pn} = m is a positive integer. Then n2−pn−m2=0n^2 - pn - m^2 = 0, and hence

n=p±p2+4m22.n = \frac{p \pm \sqrt{p^2 + 4m^2}}{2}.

Now p2+4m2=k2p^2+4m^2 = k^2 for some positive integer kk, and n=p+k2n = \frac{p+k}{2} since k>pk > p. Thus p2=(k+2m)(k−2m)p^2 = (k+2m)(k-2m), and since pp is prime we get p2=k+2mp^2 = k + 2m and k−2m=1k - 2m = 1. Hence k=p2+12k = \frac{p^2+1}{2} and

n=p+p2+122=(p+12)2n = \frac{p + \frac{p^2+1}{2}}{2} = \left(\frac{p+1}{2}\right)^2

is the only possible value of nn. In this case we have

n2−pn=(p+12)4−p(p+12)2=p+12(p2+12)2−p=p+12⋅p−12.\sqrt{n^2 - pn} = \sqrt{\left(\frac{p+1}{2}\right)^4 - p\left(\frac{p+1}{2}\right)^2} = \frac{p+1}{2}\sqrt{\left(\frac{p^2+1}{2}\right)^2 - p} = \frac{p+1}{2} \cdot \frac{p-1}{2}.

Contest context

Results from Baltic Way 2018

11 teams

Mean score
4.8 / 5
Scores of 4 or 5
11 / 11
Estonia
5 / 5

Score distribution

00
10
20
30
42
59
All team scores
TeamScore
Germany5 / 5
St. Petersburg5 / 5
Denmark5 / 5
Estonia5 / 5
Sweden4 / 5
Norway5 / 5
Lithuania5 / 5
Finland5 / 5
Latvia4 / 5
Poland5 / 5
Iceland5 / 5