[Date Index] [Thread Index] [Author Index]
Re: Russian Peasant Multiplication / was question on how to do this
On Saturday, June 29, 2013 2:47:03 AM UTC-6, Richard Fateman wrote: > Dave -- > > 1. You should try to come up with a useful subject line > > in the future. > > 2. It is called Russian Peasant Multiplication (which you may > > find on Google). > > 3. There is no reason to believe that a procedural algorithm > > has a formula, but in this case I think the inverse is known > > as division :) Thanks for the responses. IntegerDigits is basically a List function. If you pluck a number out and use it how does one then bring it back into focus? I thought about it late last night and there may be a way to do it in base ten. It gets messy when the starting number is below the base. Today I thought to just run to base two and figure it out. Basically the number ( 13 ) is 1101. All I have so far is to do a BitAnd of 1. Like this. A= BitAnd [13,1], ( this gives a 1 as 13 is odd ) A is the drop number. B= number ( 13 in this case ) -A. The carry number is then B/2. In this case 6 or 110. So when marching down the columns of numbers in the multiply this may be the easiest way to go. I will have to start to fit this into a matrix form and then figure out how to code the left or right diagonals. That does not seem straight forward at this point.