On Friday 28 September 2007, Nicholas Leippe wrote:
> Well, depends on how simple the calculator is. As long as it can represent
> a 100bit number, you can simply examine each sheep and logically or 2^(n-1)
> to your total until the following is true:
>
> log.2(2^(100) - total) is an even integer--which is the number on the
> missing sheep.

That should be, instead:

log.2(2^100 - 1 - total)

You may note that this method is impervious to double-counting, but does 
require you to get each of the 99 at least once.

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to