Bitcoin Forum
June 28, 2024, 02:23:50 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 [2]
21  Economy / Services / Re: [BOUNTY] 200$ for the first to provide purely mathematic expression of XOR on: January 27, 2014, 04:43:19 AM
I am in no way saying the last poster's solution is incorrect, but I do want to say you need to be careful with 0^0. Depending on your software choice (since OP has the strangest of conditions) 0^0 is undefined, much like 0/0 is undefined. True, most programming languages will treat 0^0 = 1, but OP may need to double check this with whatever he is using to compute the XOR function. Can check with https://www.wolframalpha.com that 0^0 is undefined.

But I am sure that won't be a problem, unless OP has extremely picky software.

LORD, this is a tough room! lol.

MP
22  Economy / Services / Re: [BOUNTY] 200$ for the first to provide purely mathematic expression of XOR on: January 26, 2014, 06:13:45 PM
Surely if the solution exists, you could just google it and paste in the solution? I'm guessing it can't be done ....

It can be done :-)  The TRAP is that without access to integer math, you cannot use division to step through the bits of each operand.  As programmers, we were all stuck on the idea of using division to shift right.  This was natural because we are all used to testing the 1s bit.  The problem is that without integer math, it was proving difficult to discard unwanted bits off the end of an operand because in floating point math, the bits don't go away, they just become decimal places.

Programmers are creatures of habit just like everyone else.  From the beginning it was far more likely that we would try to shift our way through the operands vs rotate our way through them although in retrospect, rotating might have been more flexible though definitely more obscure.

Rotate operations are just as easy to program, it's just that your bits of interest have to be rotated to the ones position from the left vs shifted (or rotated) from the right (which is probably the way 99.9 out of 100 programmers would do it.)

If you think about a rotate across a 4 bit word, take the number 5: 0101 in binary. To rotate across a 4 bit word you have to use 2^4-1, 15.

Most programmers seeking to test the second bit (2^1) would prefer to shift right 1 bit by doing an integer divide by 2, yielding 5/2 or 2: 0010.   This moves the 2nd bit to the 2^0 position where it could be tested.

The tricky part is that we can also get the second bit into the last position using a left rotate.  To accomplish this, we first multiply by 2^3 (Cool, to shift everything 3 bits to the left:

5*8= 0101 << 3 = 0101000 (40)

Now recognize that for a 4 bit word 2^4= 1 (mod 2^4-1) which means that for every multiple of 2^4 we encounter, we are adding 1 (mod 2^4-1) or that multiple multiplied by 1 (mod 2^4-1).  That accounts for the value of the bits left of 2^4, meanwhile all the bits right of 2^4 are either less than 2^4-1 OR 2^4-1 itself.  If all the bits right of 2^4 are 1, you can think of that as the same as 0 (mod 2^4-1).

To get the modulus then we add the multiple of 2^4 to the left of 2^4 to everything right of 2^4.  In other words (40 >> 4) + (40 & 15) = 2+8 = 10 = 1010.  If we check that against the actual 40%(2^4-1) or 40%15 we also get 10.  We have rotated the bit we were interested in to the 2^0 position from the left just as we would have preferred to right shift our way there.  The difference is that opposed to our disposable bit being eaten by integer division, it has appeared at the left of our 4 bit word.

Although the value of the word has changed, it doesn't matter from the standpoint of evaluating the least most significant bit as being even (0) or odd (1). Which for this challenge means that we can step through each bit of both operands to evaluate the xor function.

In my opinion, this was the biggest stumbling block because it required us as programmers to come at it from an unfamiliar angle (left rotates) vs. the approach that we are most acquainted with (right shifts).  Shift left (<< | *2) and shift right (>> | /2) two of the most commonly used tools in the programmer tool shed.  Whether he knew it or not, the OP gave us the actual tool that we needed; force of habit was probably the reason that many of us (myself included) didn't recognize it as such at first.

MP
23  Economy / Services / Re: [BOUNTY] 200$ for the first to provide purely mathematic expression of XOR on: January 26, 2014, 03:30:28 PM
I just did a few checks, however I am not sure that this operation is really a % 2^32-1 operation.
Shouldn't the modulus operator be linear? When I take it completely out, the function gives back constantly zero. I have not yet taking a deep enough look, but is this behaviour explainable?

Interestingly enough, I was just about to comment on the 2^32-1 operation when the system advised me that you had posted this response.  I'll break down the key elements of the program in steps...

It turned out that using a % 2^32-1 was ESSENTIAL to getting around the road block introduced by trying to implement right shifts as divisions by powers of 2.  The reason for this is because of the importance of getting access to the 1s bit which enables us to mask the input number (N).  Shifting right or rotating (left or right) makes it possible to step through each bit of (N) so that we can then do bitwise operations using inputs A and B.  How? Because any number N mod 2^32-1 is essentially

while (N>2^32-1)
  N=(N >> 32) + (N & 2^32-1)

This algorithm above can be derived using the fact that 2^32= 1 mod 2^32-1. So for any multiple of 2^32, that multiple mod 2^32-1 will be the multiple * 1 (mod 2^32-1). (N & 2^32-1) is the remainder < 2^32-1.  Thus iterating through this loop will eventually lead to N mod 2^32-1.  Fortunately for this challenge, we only go through the loop once to get access to any bit within the input arguments A, B.

As you described in your earlier example (with 8 bits), multiplying by powers of 2 coupled with mod 2^32-1 therefore accomplishes a rotate across 32 bits (mod 2^8-1 would be a rotate across 8 bits).   This is the method we use to set the ones bit to be the bit position within A or B that we are interested in applying the bitwise XOR function to.  The ROTATE works because we start by shifting our number N (A or B) LEFT a given number of bits.  This MAKES SPACE at the right of the number so that all bits LEFT of 2^32 will fit on the right of the number when we add (N >> 32) back on the right side (rotated).

Why is this all important and why do you get zero when you take it out?

You get zero because of the way I implemented the substitute modulus function to access the bits for the bitwise XOR:

THE KEY to understanding the alternate modulo 2 function that 0^0 is THE ONLY combination that yields 1 as an answer, ALL OTHER (positive) exponents of 0 yield 0!

Without access to INTEGER math, and armed only with the tools you gave me, I needed a way to discriminate n%2=0 from n%2=1.  Recognizing that all numbers such that N%2=1 are ODD, and all numbers such that N%2=0 are EVEN, I turned to (-1) for help.  (-1) is one of those unique numbers/bases that is binary sensitive.  Namely, that (-1)^N, no matter what the value of N yields only 2 values depending upon whether N is even or odd.  If N is even then (-1)^N equals 1, if N is odd, then (-1)^N equals -1.

Now to answer where the 0 cames from:

By adding 1 to (-1)^N, we change the range of expected values from -1, 1 to 0 (-1+1), 2 (1+1).

We now plug this into what we know about powers of 0 and get:

0^(1+(-1)^N) = N%2

if N is even, this evaluates to 0^(1+1)= 0^2= 0.  
If N is odd, this evaluates to 0^(1+(-1))= 0^0= 1.

Now we have a way to get the bit from the least most significant bit (the 1s bit) of each operand.  Originally, I like everyone else was right shifting the bits of each operand using division by powers of 2 to the ones bit position leaving the bits that I was no longer interested in to "drop off" the right side using INTEGER math.  However I couldn't use integer math, so without it, I couldn't get the discarded bits to "drop".  Instead they became decimal places to hinder my further calculations.

The sneaky part was getting the bits of interest into the ones position by ROTATING them in from the LEFT using the mod 2^32-1 operation.  In order for my alternate modulo 2 operation to work, I only care about the last bit because the last bit of N determines whether N is even or odd.  Instead of being "dropped" by a shift right operation, "discarded" bits are shifted left of the ones bit where for our purposes, THEY DON'T MATTER.  This is the essential difference between the first iteration of the program and the second iteration.  The first program discards unwanted bits by dropping them off the right using an integer function.  The second program rotates unwanted bits to the left of the ones position.

Again, the ones position is all important because it enables us a way to step through each bit of each operand (A, B), giving us a single bit to plug into our mathematically expressed XOR operation.

Concerning the XOR operation:

This too makes use of the fact that 0^0 is the only combination that yields 1, all other positive exponents yield 0.

So given bit A and bit B, a single bit XOR operation can be described as:

XOR= 0^(0^(a+b)+0^(2-(a+b)))

The truth table for a+b vs 2-(a+b) is:

a  b  a+b  2-(a+b)    0^(a+b)   0^(2-(a+b))  sum(0^(a+b)+0^(2-(a+b)))
0  0      0           2              1                  0                                       1
1  0      1           1              0                  0                                       0
0  1      1           1              0                  0                                       0
1  1      2           0              0                  1                                       1

So according to this table, the sum yields the exact opposite of what we need for XOR.
However 0^N is essentially a NOT function, so by using the sum as an exponent to 0, we
get  exactly what we are looking for:

0^1= 0
0^0= 1
0^0= 1
0^1= 0

So combining this bitwise XOR operation with the alternate modulo 2 implementation and making use of the rotate over 32 bits, we then multiply each bitwise output of the XOR function by a power of 2 representing each bit position of the result.  Lastly we sum these multiplications to build the complete bitwise XORed final output.

Thanks for the brain teaser.  This algorithm was very tricky.  When entering in as a formula, you have to be meticulous because any incorrect value introduced into the wrong exponent will yield 0 due to the fact that 0^0 is the ONLY combination that yields a non-zero value.  Once you start introducing zeros to the build multiplications, you get zeros because zero times anything is zero.

Hopefully you can now see that by removing the mod 2^32-1, you've broken the ROTATE which means that you are still left shifting the number (making space/filling the right most bit with zero) but not adding back the bits from the leftmost side of N.  This is probably evaluating all inputs to the XOR as 0, which would return 0 at every bit position, which would build an output number of 0.

Anyway, I apologize for the length of this message but I hope it explains what you are seeing and is at least a little interesting to others who may have attempted the challenge.

MP


24  Economy / Services / Re: [BOUNTY] 200$ for the first to provide purely mathematic expression of XOR on: January 26, 2014, 01:59:13 AM
Ok, I would like to revise my last submission then.

Realizing that your MOD 2^32-1 was essentially part of a rotate operation, it finally donned on me that my method of using the power properties of -1 would still work as a substitute modulus function which in turn would supply the bit inputs for the XOR function.  As long as I could via your rotate as described, I could set the 1's  bit, I could use even vs. odd powers of -1 as described in my previous post.

THE NEW PROGRAM:

#!/usr/bin/perl

$buf= <STDIN>;
my ($a, $b) = split /\s/, $buf;


$result= 0**(0**(0**(1+(-1)**($a*2**(32-0)%(2**32-1)))+0**(1+(-1)**($b*2**(32-0)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-0)%(2**32-1)))+0**(1+(-1)**($b*2**(32-0)%(2**32-1))))))+
0**(0**(0**(1+(-1)**($a*2**(32-1)%(2**32-1)))+0**(1+(-1)**($b*2**(32-1)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-1)%(2**32-1)))+0**(1+(-1)**($b*2**(32-1)%(2**32-1))))))*2+
0**(0**(0**(1+(-1)**($a*2**(32-2)%(2**32-1)))+0**(1+(-1)**($b*2**(32-2)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-2)%(2**32-1)))+0**(1+(-1)**($b*2**(32-2)%(2**32-1))))))*4+
0**(0**(0**(1+(-1)**($a*2**(32-3)%(2**32-1)))+0**(1+(-1)**($b*2**(32-3)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-3)%(2**32-1)))+0**(1+(-1)**($b*2**(32-3)%(2**32-1))))))*8+
0**(0**(0**(1+(-1)**($a*2**(32-4)%(2**32-1)))+0**(1+(-1)**($b*2**(32-4)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-4)%(2**32-1)))+0**(1+(-1)**($b*2**(32-4)%(2**32-1))))))*16+
0**(0**(0**(1+(-1)**($a*2**(32-5)%(2**32-1)))+0**(1+(-1)**($b*2**(32-5)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-5)%(2**32-1)))+0**(1+(-1)**($b*2**(32-5)%(2**32-1))))))*32+
0**(0**(0**(1+(-1)**($a*2**(32-6)%(2**32-1)))+0**(1+(-1)**($b*2**(32-6)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-6)%(2**32-1)))+0**(1+(-1)**($b*2**(32-6)%(2**32-1))))))*64+
0**(0**(0**(1+(-1)**($a*2**(32-7)%(2**32-1)))+0**(1+(-1)**($b*2**(32-7)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-7)%(2**32-1)))+0**(1+(-1)**($b*2**(32-7)%(2**32-1))))))*128+
0**(0**(0**(1+(-1)**($a*2**(32-8)%(2**32-1)))+0**(1+(-1)**($b*2**(32-8)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-8)%(2**32-1)))+0**(1+(-1)**($b*2**(32-8)%(2**32-1))))))*256+
0**(0**(0**(1+(-1)**($a*2**(32-9)%(2**32-1)))+0**(1+(-1)**($b*2**(32-9)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-9)%(2**32-1)))+0**(1+(-1)**($b*2**(32-9)%(2**32-1))))))*512+
0**(0**(0**(1+(-1)**($a*2**(32-10)%(2**32-1)))+0**(1+(-1)**($b*2**(32-10)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-10)%(2**32-1)))+0**(1+(-1)**($b*2**(32-10)%(2**32-1))))))*1024+
0**(0**(0**(1+(-1)**($a*2**(32-11)%(2**32-1)))+0**(1+(-1)**($b*2**(32-11)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-11)%(2**32-1)))+0**(1+(-1)**($b*2**(32-11)%(2**32-1))))))*2048+
0**(0**(0**(1+(-1)**($a*2**(32-12)%(2**32-1)))+0**(1+(-1)**($b*2**(32-12)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-12)%(2**32-1)))+0**(1+(-1)**($b*2**(32-12)%(2**32-1))))))*4096+
0**(0**(0**(1+(-1)**($a*2**(32-13)%(2**32-1)))+0**(1+(-1)**($b*2**(32-13)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-13)%(2**32-1)))+0**(1+(-1)**($b*2**(32-13)%(2**32-1))))))*8192+
0**(0**(0**(1+(-1)**($a*2**(32-14)%(2**32-1)))+0**(1+(-1)**($b*2**(32-14)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-14)%(2**32-1)))+0**(1+(-1)**($b*2**(32-14)%(2**32-1))))))*16384+
0**(0**(0**(1+(-1)**($a*2**(32-15)%(2**32-1)))+0**(1+(-1)**($b*2**(32-15)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-15)%(2**32-1)))+0**(1+(-1)**($b*2**(32-15)%(2**32-1))))))*32768+
0**(0**(0**(1+(-1)**($a*2**(32-16)%(2**32-1)))+0**(1+(-1)**($b*2**(32-16)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-16)%(2**32-1)))+0**(1+(-1)**($b*2**(32-16)%(2**32-1))))))*65536+
0**(0**(0**(1+(-1)**($a*2**(32-17)%(2**32-1)))+0**(1+(-1)**($b*2**(32-17)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-17)%(2**32-1)))+0**(1+(-1)**($b*2**(32-17)%(2**32-1))))))*131072+
0**(0**(0**(1+(-1)**($a*2**(32-18)%(2**32-1)))+0**(1+(-1)**($b*2**(32-18)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-18)%(2**32-1)))+0**(1+(-1)**($b*2**(32-18)%(2**32-1))))))*262144+
0**(0**(0**(1+(-1)**($a*2**(32-19)%(2**32-1)))+0**(1+(-1)**($b*2**(32-19)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-19)%(2**32-1)))+0**(1+(-1)**($b*2**(32-19)%(2**32-1))))))*524288+
0**(0**(0**(1+(-1)**($a*2**(32-20)%(2**32-1)))+0**(1+(-1)**($b*2**(32-20)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-20)%(2**32-1)))+0**(1+(-1)**($b*2**(32-20)%(2**32-1))))))*1048576+
0**(0**(0**(1+(-1)**($a*2**(32-21)%(2**32-1)))+0**(1+(-1)**($b*2**(32-21)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-21)%(2**32-1)))+0**(1+(-1)**($b*2**(32-21)%(2**32-1))))))*2097152+
0**(0**(0**(1+(-1)**($a*2**(32-22)%(2**32-1)))+0**(1+(-1)**($b*2**(32-22)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-22)%(2**32-1)))+0**(1+(-1)**($b*2**(32-22)%(2**32-1))))))*4194304+
0**(0**(0**(1+(-1)**($a*2**(32-23)%(2**32-1)))+0**(1+(-1)**($b*2**(32-23)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-23)%(2**32-1)))+0**(1+(-1)**($b*2**(32-23)%(2**32-1))))))*8388608+
0**(0**(0**(1+(-1)**($a*2**(32-24)%(2**32-1)))+0**(1+(-1)**($b*2**(32-24)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-24)%(2**32-1)))+0**(1+(-1)**($b*2**(32-24)%(2**32-1))))))*16777216+
0**(0**(0**(1+(-1)**($a*2**(32-25)%(2**32-1)))+0**(1+(-1)**($b*2**(32-25)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-25)%(2**32-1)))+0**(1+(-1)**($b*2**(32-25)%(2**32-1))))))*33554432+
0**(0**(0**(1+(-1)**($a*2**(32-26)%(2**32-1)))+0**(1+(-1)**($b*2**(32-26)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-26)%(2**32-1)))+0**(1+(-1)**($b*2**(32-26)%(2**32-1))))))*67108864+
0**(0**(0**(1+(-1)**($a*2**(32-27)%(2**32-1)))+0**(1+(-1)**($b*2**(32-27)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-27)%(2**32-1)))+0**(1+(-1)**($b*2**(32-27)%(2**32-1))))))*134217728+
0**(0**(0**(1+(-1)**($a*2**(32-28)%(2**32-1)))+0**(1+(-1)**($b*2**(32-28)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-28)%(2**32-1)))+0**(1+(-1)**($b*2**(32-28)%(2**32-1))))))*268435456+
0**(0**(0**(1+(-1)**($a*2**(32-29)%(2**32-1)))+0**(1+(-1)**($b*2**(32-29)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-29)%(2**32-1)))+0**(1+(-1)**($b*2**(32-29)%(2**32-1))))))*536870912+
0**(0**(0**(1+(-1)**($a*2**(32-30)%(2**32-1)))+0**(1+(-1)**($b*2**(32-30)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-30)%(2**32-1)))+0**(1+(-1)**($b*2**(32-30)%(2**32-1))))))*1073741824+
0**(0**(0**(1+(-1)**($a*2**(32-31)%(2**32-1)))+0**(1+(-1)**($b*2**(32-31)%(2**32-1))))+0**(2-(0**(1+(-1)**($a*2**(32-31)%(2**32-1)))+0**(1+(-1)**($b*2**(32-31)%(2**32-1))))))*2147483648;

print "$result\n";

Does this work for you?

MP
25  Economy / Services / Re: [BOUNTY] 200$ for the first to provide purely mathematic expression of XOR on: January 25, 2014, 05:47:34 AM
If it is not too late, I would like to offer a possible solution.

Basically, it uses the following formula to implement a single bit XOR:

xor (1 bit)=  0^(0^(a+b) + 0^(2-(a+b)))

I implement modulus using the following formula:

mod= 0^(1+(-1)^(N/(2^bit_position)))

It makes use of the fact that -1 to an even power yields 1, while -1 to an odd power yields -1... adding this output to 1, gives values of 0 and 2.  Raising 0 to either 0 or 2 yields 1 or 0, thus when n is even, the result is 0, and when n is odd, the result is 1... basically the same result as N mod 2.

This program is written in Perl and uses the int() function which is the same thing as the floor function.  It can be omitted entirely if done using integer math.  If this doesn't work for you, I might be able to code around it.  Anyway, here goes:

#!/usr/bin/perl

$buf= <STDIN>;
my ($a, $b)= split /\s/, $buf;

$result= 0**(0**(0**(1+(-1)**int($a))+0**(1+(-1)**int($b)))+0**(2-(0**(1+(-1)**int($a))+0**(1+(-1)**int($b)))))+
0**(0**(0**(1+(-1)**int($a/2))+0**(1+(-1)**int($b/2)))+0**(2-(0**(1+(-1)**int($a/2))+0**(1+(-1)**int($b/2)))))*2+
0**(0**(0**(1+(-1)**int($a/4))+0**(1+(-1)**int($b/4)))+0**(2-(0**(1+(-1)**int($a/4))+0**(1+(-1)**int($b/4)))))*4+
0**(0**(0**(1+(-1)**int($a/8))+0**(1+(-1)**int($b/8)))+0**(2-(0**(1+(-1)**int($a/8))+0**(1+(-1)**int($b/8)))))*8+
0**(0**(0**(1+(-1)**int($a/16))+0**(1+(-1)**int($b/16)))+0**(2-(0**(1+(-1)**int($a/16))+0**(1+(-1)**int($b/16)))))*16+
0**(0**(0**(1+(-1)**int($a/32))+0**(1+(-1)**int($b/32)))+0**(2-(0**(1+(-1)**int($a/32))+0**(1+(-1)**int($b/32)))))*32+
0**(0**(0**(1+(-1)**int($a/64))+0**(1+(-1)**int($b/64)))+0**(2-(0**(1+(-1)**int($a/64))+0**(1+(-1)**int($b/64)))))*64+
0**(0**(0**(1+(-1)**int($a/128))+0**(1+(-1)**int($b/128)))+0**(2-(0**(1+(-1)**int($a/128))+0**(1+(-1)**int($b/128)))))*128+
0**(0**(0**(1+(-1)**int($a/256))+0**(1+(-1)**int($b/256)))+0**(2-(0**(1+(-1)**int($a/256))+0**(1+(-1)**int($b/256)))))*256+
0**(0**(0**(1+(-1)**int($a/512))+0**(1+(-1)**int($b/512)))+0**(2-(0**(1+(-1)**int($a/512))+0**(1+(-1)**int($b/512)))))*512+
0**(0**(0**(1+(-1)**int($a/1024))+0**(1+(-1)**int($b/1024)))+0**(2-(0**(1+(-1)**int($a/1024))+0**(1+(-1)**int($b/1024)))))*1024+
0**(0**(0**(1+(-1)**int($a/2048))+0**(1+(-1)**int($b/2048)))+0**(2-(0**(1+(-1)**int($a/2048))+0**(1+(-1)**int($b/2048)))))*2048+
0**(0**(0**(1+(-1)**int($a/4096))+0**(1+(-1)**int($b/4096)))+0**(2-(0**(1+(-1)**int($a/4096))+0**(1+(-1)**int($b/4096)))))*4096+
0**(0**(0**(1+(-1)**int($a/8192))+0**(1+(-1)**int($b/8192)))+0**(2-(0**(1+(-1)**int($a/8192))+0**(1+(-1)**int($b/8192)))))*8192+
0**(0**(0**(1+(-1)**int($a/16384))+0**(1+(-1)**int($b/16384)))+0**(2-(0**(1+(-1)**int($a/16384))+0**(1+(-1)**int($b/16384)))))*16384+
0**(0**(0**(1+(-1)**int($a/32768))+0**(1+(-1)**int($b/32768)))+0**(2-(0**(1+(-1)**int($a/32768))+0**(1+(-1)**int($b/32768)))))*32768+
0**(0**(0**(1+(-1)**int($a/65536))+0**(1+(-1)**int($b/65536)))+0**(2-(0**(1+(-1)**int($a/65536))+0**(1+(-1)**int($b/65536)))))*65536+
0**(0**(0**(1+(-1)**int($a/131072))+0**(1+(-1)**int($b/131072)))+0**(2-(0**(1+(-1)**int($a/131072))+0**(1+(-1)**int($b/131072)))))*131072+
0**(0**(0**(1+(-1)**int($a/262144))+0**(1+(-1)**int($b/262144)))+0**(2-(0**(1+(-1)**int($a/262144))+0**(1+(-1)**int($b/262144)))))*262144+
0**(0**(0**(1+(-1)**int($a/524288))+0**(1+(-1)**int($b/524288)))+0**(2-(0**(1+(-1)**int($a/524288))+0**(1+(-1)**int($b/524288)))))*524288+
0**(0**(0**(1+(-1)**int($a/1048576))+0**(1+(-1)**int($b/1048576)))+0**(2-(0**(1+(-1)**int($a/1048576))+0**(1+(-1)**int($b/1048576)))))*1048576+
0**(0**(0**(1+(-1)**int($a/2097152))+0**(1+(-1)**int($b/2097152)))+0**(2-(0**(1+(-1)**int($a/2097152))+0**(1+(-1)**int($b/2097152)))))*2097152+
0**(0**(0**(1+(-1)**int($a/4194304))+0**(1+(-1)**int($b/4194304)))+0**(2-(0**(1+(-1)**int($a/4194304))+0**(1+(-1)**int($b/4194304)))))*4194304+
0**(0**(0**(1+(-1)**int($a/8388608))+0**(1+(-1)**int($b/8388608)))+0**(2-(0**(1+(-1)**int($a/8388608))+0**(1+(-1)**int($b/8388608)))))*8388608+
0**(0**(0**(1+(-1)**int($a/16777216))+0**(1+(-1)**int($b/16777216)))+0**(2-(0**(1+(-1)**int($a/16777216))+0**(1+(-1)**int($b/16777216)))))*16777216+
0**(0**(0**(1+(-1)**int($a/33554432))+0**(1+(-1)**int($b/33554432)))+0**(2-(0**(1+(-1)**int($a/33554432))+0**(1+(-1)**int($b/33554432)))))*33554432+
0**(0**(0**(1+(-1)**int($a/67108864))+0**(1+(-1)**int($b/67108864)))+0**(2-(0**(1+(-1)**int($a/67108864))+0**(1+(-1)**int($b/67108864)))))*67108864+
0**(0**(0**(1+(-1)**int($a/134217728))+0**(1+(-1)**int($b/134217728)))+0**(2-(0**(1+(-1)**int($a/134217728))+0**(1+(-1)**int($b/134217728)))))*134217728+
0**(0**(0**(1+(-1)**int($a/268435456))+0**(1+(-1)**int($b/268435456)))+0**(2-(0**(1+(-1)**int($a/268435456))+0**(1+(-1)**int($b/268435456)))))*268435456+
0**(0**(0**(1+(-1)**int($a/536870912))+0**(1+(-1)**int($b/536870912)))+0**(2-(0**(1+(-1)**int($a/536870912))+0**(1+(-1)**int($b/536870912)))))*536870912+
0**(0**(0**(1+(-1)**int($a/1073741824))+0**(1+(-1)**int($b/1073741824)))+0**(2-(0**(1+(-1)**int($a/1073741824))+0**(1+(-1)**int($b/1073741824)))))*1073741824+
0**(0**(0**(1+(-1)**int($a/2147483648))+0**(1+(-1)**int($b/2147483648)))+0**(2-(0**(1+(-1)**int($a/2147483648))+0**(1+(-1)**int($b/2147483648)))))*2147483648;

print "$result\n";

Pages: « 1 [2]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!