Problem

Source:

Tags: floor function, induction, Recursive Sequences



An integer sequence $\{a_{n}\}_{n \ge 1}$ is defined by \[a_{1}=1, \; a_{n+1}=a_{n}+\lfloor \sqrt{a_{n}}\rfloor.\] Show that $a_{n}$ is a square if and only if $n=2^{k}+k-2$ for some $k \in \mathbb{N}$.