Xor-sequence

  • + 0 comments

    Okay maybe I get another tip. XOR has mathematical interessing properties: Commutativity, Associativity and A⊕A=0. And if you study the given function et take an example.
    here the whole sequence:
    A0 = 0
    A1 = 0⊕1
    A2 = 0⊕1⊕2
    A3 = 0⊕1⊕2⊕3
    A4 = 0⊕1⊕2⊕3⊕4
    A5 = 0⊕1⊕2⊕3⊕4⊕5
    A6 = 0⊕1⊕2⊕3⊕4⊕5⊕6
    A7 = 0⊕1⊕2⊕3⊕4⊕5⊕6⊕7
    A8 = 0⊕1⊕2⊕3⊕4⊕5⊕6⊕7⊕8
    ...
    Test case 0: (Li,Ri) = (2,4)
    so we get:
    A2 = 0⊕1⊕2
    A3 = 0⊕1⊕2⊕3
    A4 = 0⊕1⊕2⊕3⊕4
    et compute A2⊕A3⊕A4:
    A2⊕A3⊕A4 = 0⊕1⊕2⊕0⊕1⊕2⊕3⊕0⊕1⊕2⊕3⊕4
    and factorize it:
    A2⊕A3⊕A4 = 0⊕0⊕0⊕1⊕1⊕1⊕2⊕2⊕2⊕3⊕3⊕4
    and then reduce it:
    A2⊕A3⊕A4 = 1⊕2⊕4
    you finaly get the result:
    A2⊕A3⊕A4 = 7.