def fermat_number(n: int) -> int:
    """
    https://en.wikipedia.org/wiki/Fermat_number
    https://oeis.org/A000215

    >>> [fermat_number(i) for i in range(5)]
    [3, 5, 17, 257, 65537]
    """
    return 3 if n == 0 else (2 << ((2 << (n - 1)) - 1)) + 1