The ContinuedFraction command generates the continued fraction expansion for a number.

ContinuedFraction[541/523]

If the expansion doesn’t terminate but repeats a sequence of digits, the repeating sequence is put into a list.

ContinuedFraction[Sqrt[2]]

The FromContinuedFraction command generates numbers from continued fractions.  The same convention holds for repeating strings of digits.

FromContinuedFraction[{1,29,18}]

This number has continued fraction expansion [1;2,3,2,2,3,2,2,3,2...].

FromContinuedFraction[{1,{2,3,2}}]

ContinuedFraction[Pi,10]

ContinuedFraction[E,10]

ContinuedFraction[457/23]

FromContinuedFraction[%]

The ContinuedFractionK[g, {i, imin, imax}] command generates the continued fraction for 1/g subject to the limits specified.

ContinuedFractionK[Mod[n,5]+1, {n,1,Infinity}]

ContinuedFraction[{2, 3, 4,5, 1}]

ContinuedFractionK[1, {n,1,Infinity}]

ContinuedFractionK[2n+1, {n,1,10}]