How about: Repeat 1. Express in binary the absolute value of (the sum of the even places minus the sum of the odd places) until a fixed point is reached. If it's 0, you can divide by 3; else not. ? —Dan
On May 24, 2016, at 11:04 AM, Victor Miller <victorsmiller@gmail.com> wrote:
Dan, Sure. Use the fact that 2^2 = 1 mod 3, so you "cast out 3's" -- take pairs of digits in binary, and add them up, and repeat the process as long as you have more than 2 bits.
For example 27 = 11011, so 11011 --> 1 + 10 + 11 = 110 --> 1 + 10 = 11, which is 3.
Victor
On Tue, May 24, 2016 at 1:52 PM, Dan Asimov <dasimov@earthlink.net> wrote:
Zak, good question: Is there a quick way to detect multiples of 3 expressed in base 2 ??? Let's see:
(2 + 1) (2^a + 2^b + ... + 2^c) =
2^(a+1) + 2^a + 2^(b+1) + 2^b + ... + 2^(c+1) + 2^c.
Hmm, if all these exponents are distinct, this pattern seems very easy to detect.
But what if some of the exponents are equal?
I bet there's a simple algorithm to untangle them.
But I may be wrong.
—Dan
On May 24, 2016, at 9:56 AM, Zak Seidov via math-fun < math-fun@mailman.xmission.com> wrote:
Also, in our native, base - 10, numbers divisible by 3 has sum of digits also divisible by 3, while base - 2 has nothing similar.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun