Let p be the product of the first 1000 primes. From calculations we can see that p has around 3000 digits.
Any number a less than p can be represented as an array a1,…,ak, where ai = a (mod pi). But to do this we obviously need to know how to get back the number a from its representation.
Garner's Algorithm can be used for this purpose. We seek a representation on the form
a=x1 + x2p1 + x3p1p2 +…+ xkp1…pk−1
@SKAUL05 @hushee69 @iamrajiv
Garner's Algorithm in Java
Let p be the product of the first 1000 primes. From calculations we can see that p has around 3000 digits.
Any number a less than p can be represented as an array a1,…,ak, where ai = a (mod pi). But to do this we obviously need to know how to get back the number a from its representation.
Garner's Algorithm can be used for this purpose. We seek a representation on the form a=x1 + x2p1 + x3p1p2 +…+ xkp1…pk−1
I want to implement this algorithm in Java.