def fock_representation(n, N):
    """
    Converts from the parity representation to the Fock representation.
    
    :param n: any positive integer
    :param N: number of bits/qubits used in representing the integer `n`
    :returns: the integer representing the Fock mapped value
    """
    mask = 2 ** (N) - 1
    fock_rep = n ^ (n << 1)
    #print(f'{n} = {n:b}: {fock_rep:04b} {mask:04b}')
    return fock_rep & mask