I was trying to prove that $c$ was of form $2p-1$ knowing that $c^2$ was of form $4k+1$. Now, the solution is obviously $\sqrt{4k+1}$, but knowing that both $c$ and $k$ were integers, I tried to figure out what form $c$ could take. I went to Desmos and graphed the function $f(k)=\sqrt{4k+1}$, and the first ten points with integer coordinates I got were $(0, 1), (2,3), (6,5), (12,7), (20,9), (30,11), (42,13), (56,15), (72,17),$ and $(90,19)$. My computer quickly figured out that the pattern for the $x$-coordinate, with the point number being $p$, was $p^2-p$. The pattern for the $y$-coordinate is obviously $2p-1$. Thus, I concluded that k must be of form $p^2-p$ and $c$ must be of form $2p-1$.
My question is: Is there an algebraic way to do what I did? If so, how would I go about it?
Square root of an odd perfect square is odd. Every odd number is of the form $2p-1$ for some integer $p$.