HP3000-L Archives

December 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Barry Lake <[log in to unmask]>
Reply To:
Barry Lake <[log in to unmask]>
Date:
Mon, 4 Dec 2000 08:19:55 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
At 8:12 AM -0700 12/4/00, Dave Darnell wrote:
>?? I'm getting non-powers of the base:
>
>ASTRO/DARNELL/PUB(1):comeau 127,8
>127 = 7+56+64
>Written as 177 in base 8
>ASTRO/DARNELL/PUB(1):calc 8*8*8
>512, $200, %1000
>ASTRO/DARNELL/PUB(1):calc 8*8
>64, $40, %100
>ASTRO/DARNELL/PUB(1):calc 8*7
>56, $38, %70
>ASTRO/DARNELL/PUB(1):
>
>56 is not a power of 8

But 56 is a multiple of a power of 8.

Try running the script with the third parameter provided:

  :powersum 127,8,detail
  127 = (7*1)+(7*8)+64

Base 2 is a special case. At any level or power you can only have either
zero or one multiple of that power added into the sum. If you have two,
then you've moved up to the next power.

For example, 3 would be "1+2" and 5 might be "1+(2*2)". But since 2*2 is a
power of two (as well as a multiple of a power of two), we have to say
"1+4". In the case of base 8, or any other base higher than two, it is not
possible represent all numbers as sums of single multiples of the powers of
the base. In other words, your misunderstanding is that you are thinking
about base 8 as if it were base 2.

ATOM RSS1 RSS2