In a cryptarithm, numbers are represented by replacing their digits by letters; a given letter consistently represents the same digit and different letters represent different digits. Leading zeroes are not permitted. Solve the following cryptarithm:

SEVEN is prime, and

NINE is a perfect square.

Update

The intent of the original problem was to work base 10. Robin Stokes asks about solutions in other bases.