def _is_p_power(a, p):

    """
    Determine whether ``a`` is a ``p`` th power.

    INPUT:

    - ``a`` -- an integer

    - ``p`` -- a prime number

    OUTPUT:

    - True if ``a`` is a ``p`` th power; else False.


    EXAMPLES::

        sage: sage.combinat.binary_recurrence_sequences._is_p_power(2**7,7)
        True
        sage: sage.combinat.binary_recurrence_sequences._is_p_power(2**7*3**2,7)
        False

    """

    return (int(a**(1/p))**p == a)