Problem

Source: 2023 Mathematics Regional Olympiad of Mexico West P1

Tags: number theory, divisor



For every positive integer $n$ we take the greatest divisor $d$ of $n$ such that $d\leq \sqrt{n}$ and we define $a_n=\frac{n}{d}-d$. Prove that in the sequence $a_1,a_2,a_3,...$, any non negative integer $k$ its in the sequence infinitely many times.