Let $S:\mathbb{N}\to\mathbb{Z}^+$ satisfy $$ \left\{ \begin{aligned} S(n) &= S(A^n \bmod n) + S(B^n \bmod n) \\ S(0) &= 1 \end{aligned} \right. $$
My question is, is this function always surjective for all values of $A, B \geq 2$ with $A \neq B$?
(When $A$'s and $B$'s set of prime factor are completely the same, odd numbers are unobtainable. Is this the only case where surjectivity fails?)