
Problem 2. The quadratic function $f(x)=-x^{2}+4 p x-p+1$ is given. Let $S$ be the area of the triangle with vertices at the intersection points of the parabola $y=f(x)$ with the $x$-axis and the vertex of the same parabola. Find all rational $p$, for which $S$ is an integer.


Solution. The discriminant of $f(x)$ is $D=4\left(4 p^{2}-p+1\right)$ and $D>0$ for all real $p$. Consequently $f(x)$ has two real roots $x_{1}$ and $x_{2}$, i.e. $f(x)$ intersects the $x$-axis in two different points $-A$ and $B$. The vertex $C$ of the parabola has coordinates $2 p$ and $h=f(2 p)=4 p^{2}-p+1>0$. We have

$$
A B=\left|x_{1}-x_{2}\right|=\sqrt{\left(x_{1}-x_{2}\right)^{2}}=\sqrt{\left(x_{1}+x_{2}\right)^{2}-4 x_{1} x_{2}}=2 \sqrt{4 p^{2}-p+1}
$$

Now we find $S=S_{A B C}=\frac{A B \cdot h}{2}=\left(4 p^{2}-p+1\right)^{\frac{3}{2}}$. Denote $q=4 p^{2}-p+1$. Since $q$ is rational and $q^{3}=S^{2}$ is an integer, then $q$ is an integer too. Then $\frac{S}{q}$ is rational and $\left(\frac{S}{q}\right)^{2}=q$ is integer,
thus $\frac{S}{q}$ is integer too. Therefore $q=n^{2}$, where $n$ is a positive integer, i.e. $4 p^{2}-p+1-n^{2}=0$. The quadratic equation (with respect to $p$ ) has a rational root exactly when its discriminant $16 n^{2}-15$ is a square of a rational number. Consequently $16 n^{2}-15=m^{2}$, and we can consider $m$ to be a positive integer. From the equality $(4 n-m)(4 n+m)=15$ we get $4 n-m=1$, $4 n+m=15$ or $4 n-m=3,4 n+m=5$. From here $n=2, m=7$ or $n=1, m=1$. The rational numbers we are looking for are $0,1, \frac{1}{4},-\frac{3}{4}$.
