def next_look_and_say(n):
    """Returns the next number of the "look-and-say" sequence given the previous
    term n. The first term is 1. To generate a term in the sequence, look at the
    previous term and read it. 1 is "one 1", which translates into 11. 11 is
    then read as "two 1s," which translates into 21.

    >>> next_look_and_say(1)
    11
    >>> next_look_and_say(111221)
    312211
    """
    def count_digits(m):
        m, digit, count = m // 10, m % 10, 1
        while m % 10 == digit:
            m, count = m // 10, count + 1
        return m, digit, count
    new = i = 0
    while n:
        n, digit, count = count_digits(n)
        new, i = new + (10**(i+1) * count) + (10**i * digit), i + 2
    return new