https://forthright48.com/euler-totient-or-phi-function from this link see the section "Theorem Related to Arithmetic Progression" .