1 Attachment(s)
BZP says "Chinese Remainder Theorem"
FYI:
Given the numbers 0 thru n, if you use the First R Prime numbers, and mod them, Just so long as N < the Multple of the first R prime numbers, then you will end up with a unique numerical sequence that represents each such number.
ie..: Referencing the primes 2,3,and 5, the numbers 0 thru 7 could be seen as:
0=0,0,0
1=1,1,1
2=0,2,2
3=1,0,3
4=0,1,4
5=1,2,0
6=0,0,1
7=1,1,2
and so on...
Obviuosly Cols 1, 2, and 3 are the results of taking the Target number and Modding it by the prime whose index is identical to that of the columns.
But, heres the delema: How do you go in revers?
Well, if you only use the primes 2 and 3, the equation is:
Num = {3*Pos(Prime2) + 4*Pos(Prime3)} Mod 2*3
If you use 2,3, and 5:
Num = {15*Pos(Prime2) + 10*Pos(Prime3) + 6*Pos(Prime5)} Mod 2*3*5
and actually, its really simple to figure, once youve done your homework.
Check the attached table:
to be continued...
http://www.vbforums.com/attachment.p...postid=1504615
;)
errr? Wheres the image???