Problem

Source: Baltic Way 2015

Tags: polynomial, algebra, number theory



Denote by $P(n)$ the greatest prime divisor of $n$. Find all integers $n\geq 2$ for which \[P(n)+\lfloor\sqrt{n}\rfloor=P(n+1)+\lfloor\sqrt{n+1}\rfloor\]