Possible Duplicate:
How to do +, -, *, / with number in a base b?
I am reading research papers in the category of recreational mathematics on the topic of numbers similar to Kaprekar number. Almost all the time we come across subtration of numbers with arbritrary bases such as 11, 13, 8 etc..
Can someone please explain me as to how this kind of calculation is to be done? Is there any free calculator/software available on net that does this kind of calculation?
Let us subtract
313663from403155in base 11. Digits in base 11 are0,1,2,3,4,5,6,7,8,9,A. In base 11, instead of writing 10 + 1 = 11, we writeA+1=10. And instead of writing 10 + 10 = 20, we writeA+A=19. I will write base-11 numerals in this special font with the gray background, so that they are easy to recognize.Let's call the columns, in order from right to left, columns $C_0, C_1,\ldots C_5$. The algorithm is the same as in base 10, except that we use 11 instead of 10. We start in column $C_0$.
5-3is2:In column $C_1$, we have
5-6, which is negative, so we borrow an 11 from the1in column $C_2$ and change the5to a15.Note that the
15in column $C_1$ is not the base-ten 15; it is the base-eleven15, which is base-ten 16.15-6=A.Now we can't take
6from0, so we borrow an 11 from the3in the $C_3$ column:10-6=5:Now in column $C_3$ we have
2-3, so we sould like to borrow from $C_4$, but $C_4$ has a0, so there is nothing to borrow. So instead we borrow 11 from $C_5$ to $C_4$:And then we can borrow from $C_4$ to $C_3$:
Now in column $C_3$ we have
12-3=A, and in column $C_4$ we haveA-1=9:And finally in column $C_5$ we have
3-3=0, so we are done, and the answer is403155-313663=9A5A2.