Using the symbol \(v\) for the speed of light, we find that the time for light to return to the wheel will be
\begin{equation*}
\Delta t = \dfrac{2d}{v}.
\end{equation*}
When we look at the motion of the wheel, during this time the wheel needs to rotate so that its the time between the subsequent openings in the wheel in the path of the light. In 1 sec the wheel will rotate through \(n\times N\) teeth. Therefore, the time between teeth will be
\begin{equation*}
\Delta t' = \dfrac{1}{nN}.
\end{equation*}
Equating \(\Delta t\) with \(\Delta t'\) gives
\begin{equation*}
\dfrac{2d}{v} = \dfrac{1}{nN},\ \ \Longrightarrow\ \ v = 2\, d\, n\,N.
\end{equation*}