The continued fraction of a number \$n\$ is a fraction of the following form:
$$a_0 + \cfrac 1 {a_1 + \cfrac 1 {a_2 + \cfrac 1 {a_3 + \cfrac 1 {a_4 + \ddots}}}}$$
which converges to \$n\$.
The sequence \$a\$ in a continued fraction is typically written as: \$[a_0; a_1, a_2, a_3, ... a_n]\$.
We will write ours in the same fashion, but with the repeating part between semicolons.
Your goal is to return the continued fraction of the square root of \$n\$.
Input: An integer, \$n\$. \$n\$ will never be a perfect square.
Output: The continued fraction of \$\sqrt n\$.
Test Cases:
2 -> [1; 2;]
3 -> [1; 1, 2;]
19 -> [4; 2, 1, 3, 1, 2, 8;]
Shortest code wins. Good luck!