0

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)$

  • Well, I suspect not since if we have N as congruent to M modulo $a+b+c$, then we have that $\frac{a+b+c}{N-M}$ is an integer but this doesn't imply that $\frac{a}{N-M}$, $\frac{b}{N-M}$ or $\frac{c}{N-M}$ are integers. – user328442 Dec 11 '16 at 18:35
  • Please gives some examples of the moduli you are considering. You can't expect much at that level of generality. – Bill Dubuque Dec 11 '16 at 19:09
  • @BillDubuque I have added a better explanation with examples. – user7281297 Dec 11 '16 at 20:13

0 Answers0