import math


def len_fraction_expansion_sqrt_period(x):
    """
    Returns the period length of the continued fraction expansion of sqrt(x)
    """
    a_0 = math.floor(math.sqrt(x))
    b = a_0
    c = x - a_0**2
    len_ = 1
    seen = [[b, c]]
    while True:
        a = math.floor((a_0 + b)/c)
        b = int(a*c - b)
        c = int((x - b**2)/c)
        if [b, c] in seen:
            return(len_)
        seen.append([b, c])
        len_ += 1