Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15116

Re: Russian Peasant Multiplication / was question on

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Russian Peasant Multiplication / was question on
Date 2013-07-03 08:53 +0000
Message-ID <kr0oph$3f2$1@smc.vnet.net> (permalink)
References <kqm6u7$hp5$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


x = RandomInteger[{-1000000, 1000000}]


99333


id = IntegerDigits[x]


{9, 9, 3, 3, 3}


pwr10 = 10^Range[Length[id] - 1, 0, -1]


{10000, 1000, 100, 10, 1}


id*pwr10


{90000, 9000, 300, 30, 3}


x ==
 Sign[x]*id.pwr10 ==
 Sign[x]*Dot[id, pwr10] ==
 Sign[x]*Total[id*pwr10] ==
 Sign[x]*Plus @@ (id*pwr10)


True



Bob Hanlon




On Tue, Jul 2, 2013 at 12:49 AM, <d.a.paxton@gmail.com> wrote:

> 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 :)
>
> Bob,  Thanks on that.  I see the use of the floor function.  This whole
> idea is trivial when one can use that.  What I am trying to do is basically
> do the floor function as a linear equation.  This is useful for pulling
> numbers apart.  Like a number 13.  How does one algebraically make it 1 and
> 3 or 10 and 3.  Either.
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Russian Peasant Multiplication / was question on how to do this Richard Fateman <fateman@cs.berkeley.edu> - 2013-06-29 08:47 +0000
  Re: Russian Peasant Multiplication / was question on how to do this d.a.paxton@gmail.com - 2013-06-30 07:26 +0000
  Re: Russian Peasant Multiplication / was question on Bob Hanlon <hanlonr357@gmail.com> - 2013-07-01 09:45 +0000
  Re: Russian Peasant Multiplication / was question on how to do this d.a.paxton@gmail.com - 2013-07-02 04:35 +0000
  Re: Russian Peasant Multiplication / was question on James Stein <mathgroup@stein.org> - 2013-07-03 08:47 +0000
  Re: Russian Peasant Multiplication / was question on how to do this d.a.paxton@gmail.com - 2013-07-03 08:50 +0000
  Re: Russian Peasant Multiplication / was question on Bob Hanlon <hanlonr357@gmail.com> - 2013-07-03 08:53 +0000

csiph-web