Results 1 to 4 of 4

Thread: BZP says "Chinese Remainder Theorem"

Threaded View

  1. #1

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    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...





    errr? Wheres the image???
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width