With the expression N mod (a+b+c), is there any way to perform the operation without taking the direct sum of a, b, and c?
Edit--examples:
I plan to use whatever solutions to this I can find for programming large-number Lucas-Lehmer tests. As (2^p)-1 can be written in hexadecimal as a single number followed by a string of F's (such as (2^33)-1 = 1ffffffff base 16), this could be computed piece by piece without overflowing--however, since this is a Lucas-Lehmer test, most of the steps along the way require the following operation:
$[(L_n^2)-2] mod [(2^p)-1]$
where $L_n$ is the nth number in the Lucas-Lehmer sequence.
Thus, in order to refrain from directly computing $(2^p)-1$, I need to find a way of performing the mod function piece by piece on the string of f's, such that the result is equal to the expression above. For a specific example:
$[(L_{33}^2)-2]mod(10000000+f0000000+f000000+f00000+f0000+f000+f00+f0+f)$