Q:

Can x mod (N - a) or x mod (N + a) be calculated just by knowing x mod N??

Can x mod (N - a) or x mod (N + a) be calculated just by knowing x mod N? where a is an arbitrary integer, and N is a prime. e.g. i know 22! mod 23 ≡ 22 using Wilson's theorem. lets say i want to know 22! mod 24, is there a way i can do so without solving the factorial?

A:

If $\,d := \gcd(n,m)=1\,$ then there is no relationship between $\,a = x\bmod n\,$ and $\, b = x\bmod m\,$ since CRT $\,\Rightarrow\,x\equiv a\pmod{\!n},\ x\equiv b\pmod{\! m}\ $ is solvable for all values of  $\,a,b.\,$ This is true in your example $\iff 1 = \gcd(n,n\pm a) = \gcd(n,a).$ 
However, when $\,d > 1\,$a solution exists iff $\,b\equiv a\pmod{\!d},\,$ and this does place constraints on the values $\,b\,$ that $\,x\,$ can take $\!\bmod m$. Then $\,b\,$ is determined uniquely iff $\,m\mid d\iff m\mid n\ $ (i.e. iff $\,n\pm a\mid n\,$ in your example), hence $\,x\bmod m = (x\bmod n)\bmod m\,$ is uniquely determined. This arises frequently, e.g. knowing $\, u = x\bmod 10 = $ units digit of $x$ we can compute its parity by taking the parity of its units digit, i.e. $\ x\bmod 2 = (x\bmod 10)\bmod 2 = u\bmod 2,\,$ e.g. $\,123\bmod 2 = 3\bmod 2 = 1$.

