For this problem we can use 2 equations.
(1) - E = mC²
E = Energy of photon (J)
m = Mass of photon (kg) (1.67x10⁻²⁷ kg)
C = speed of light (3 x 10⁸ m/s)
(2) - E = hf
E = Energy of photon (J)
h = plank's constant (6.63 × 10⁻³⁴J s)
f = frequency of the photon (Hz)
(1) = (2)
hence, mC² = fh
by rearranging,
f = mC² / h
f = 1.67x10⁻²⁷ kg * (3 x 10⁸ m/s)² / (6.63 × 10⁻³⁴J s)
f = 2.27 x 10²³ Hz