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:
Dave Darnell <[log in to unmask]>
Reply To:
Dave Darnell <[log in to unmask]>
Date:
Fri, 1 Dec 2000 12:01:29 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
Allen,

2 ways:

Convert to binary and the powers of 2 that are represented by a "1" are the
values you want.  The rightmost is 2 to the zero power, so if it is a "1"
then 1 is one of the numbers you want.  "101" is 1*(2**0) + 0*(2**1) +
1*(2**2), or 1 + 0 + 4.

The other way is to find the power of two that is not greater than the
number you want to break down, that is one of the component numbers.
Subtract it from the original. Do the same to the difference......  It would
be handy to use Excel to print a table of the powers of two.

-Dave

> -----Original Message-----
> From: Porter, Allen H [mailto:[log in to unmask]]
> Sent: Friday, December 01, 2000 11:45 AM
> To: [log in to unmask]
> Subject: Math Help
>
>
> OK, I'm trying to figure this out but I cannot remember how
> to do the math
> behind it.
>
> If I have a series such as
> 1
> 2
> 4
> 8
> 16
> 32
> 64
> 128
>
> and I add any combination of these numbers together (4 + 16 =
> 20) the only
> way I can come up with the number 20 is by adding 4 and 16.
> Now how do I do
> this in reverse?  If I know the sum is 81, how do I determine that the
> numbers that make up this sum are 1 + 16 + 64?
>
> Thanks to anyone with the solution.
>

ATOM RSS1 RSS2