I was studying Fermat's little theorem which states that if $x$ if prime, we have:

$(A^x-A) \bmod (x)=0$

$(A^x-A) \bmod (6)=0$

And obviously:

$(A^x-A) \bmod (A)=0$

I wanted to see if there are any other interesting properties and I found the following:

Regardless to if $x$ is prime, when both $A$ and $x$ are odd integers greater than $1$

$(A^x-A) \bmod ((A-1)/2) = 0$ and $(A^x-A) \bmod (((A-1)/2)+1) = 0$

Random Examples:

$(13^7-13) \bmod (6)=0$ and $(13^7-13) \bmod (7)=0$

$(21^5-21) \bmod (10)=0$ and $(21^5-21) \bmod (11)=0$

$(47^{11}-47) \bmod (23)=0$ and $(47^{11} -47) \bmod (24)=0$

$(59^3-59) \bmod (29)=0$ and $(59^3-59) \bmod (30)=0$

$(61^{11}-61) \bmod (30)=0$ and $(61^{11}-61) \bmod (31)=0$

$(35^{13}-35) \bmod (17)=0$ and $(35^{13}-35) \bmod (18)=0$

Am I correct about this or are there any counterexamples? If I am correct Is there a proof or an explanation in regards to why it is happening?