Loading ...
Sorry, an error occurred while loading the content.

Re: [PrimeNumbers] Brain Teaser

Expand Messages
  • MICHAEL HARTLEY
    To: Prime Numbers From: Jon Perry Date sent: Thu, 4 Oct 2001 22:51:33
    Message 1 of 13 , Oct 5, 2001
    • 0 Attachment
      To: "Prime Numbers" <primenumbers@yahoogroups.com>
      From: "Jon Perry" <perry@...>
      Date sent: Thu, 4 Oct 2001 22:51:33 +0100
      Subject: [PrimeNumbers] Brain Teaser

      > Should be quite simple this one.
      >
      > What is the highest power of two that divides ab+bc+ca?
      >
      > e.g.a=1, b=2, c=3, ab+bc+ca=2+6+3=11, therefore 0.
      >
      > a=2,b=2,c=3 ab+bc+ca=4+6+6=16, therefore 4.

      Here's my (version 1) "solution":

      Let a, b, c be 2^i.s, 2^j.t, 2^k.u, where s,t,u are odd, and i <= j <= k

      1) If j < k or i=j=k:
      answer is i+j

      2) If i<j=k:
      Let t+u = 2^m.v, v is odd

      2.1) If i+m > j:
      Answer is 2j

      2.2) If i+m < j:
      Answer is i+j+m

      2.3) If i+m = j:
      Let sv+tu = 2^n.w, w is odd.
      Answer is 2j+n = i+j+m+n

      Messy... :-(

      Michael Hartley : Michael.Hartley@...
      Head, Department of Information Technology,
      Sepang Institute of Technology
      +---Q-u-o-t-a-b-l-e---Q-u-o-t-e----------------------------------
      "There was a young man from Peru,
      Whose limericks stopped at line two."
      -- Spike Milligan
    • Jon Perry
      If you consider 2,5,10, i.e. A=2^0*5 B=2^1*1 C=2^1*5 ... (r+s) in this case translates to (s+t), or (1+5)=6, therefore k=1. ... (c+k) becomes a+k = 1. a
      Message 2 of 13 , Oct 6, 2001
      • 0 Attachment
        If you consider 2,5,10, i.e.

        A=2^0*5
        B=2^1*1
        C=2^1*5

        b and c are equal. Hence:

        >3) If 2 only are equal, say a = b, it comes

        >S = 2^(a+a)rs + 2^(a+c)rt + 2^(a+c)st
        >S = 2^(2a)rs + 2^(a+c+k)t(r+s)/2^k
        >where 2^k is the highest power of 2 that divides (r+s),

        (r+s) in this case translates to (s+t), or (1+5)=6, therefore k=1.


        >Once more, there are 3 cases:
        >1) if (c+k) > a, the result is 2^(2a)
        >2) if (c+k) < a, the result is 2^(a+c+k)
        >3) if (c+k) = a, the result is 2^(2a+h) where 2^h is the greatest
        > power of 2 that divides rs + t(r+s)/2^k

        (c+k) becomes a+k = 1. a becomes what?

        Say a becomes b=1. a+k=b, therefore 2^(0+1+1)=4
        Say a becomes c=1. a+k=c, therefore 4 again.

        Only the answer to ab+bc+ca is 80.

        Jon Perry
        perry@...
        http://www.users.globalnet.co.uk/~perry
        BrainBench MVP for HTML and JavaScript
        http://www.brainbench.com


        -----Original Message-----
        From: Marcel Martin [mailto:znz@...]
        Sent: 04 October 2001 23:46
        Cc: Prime Numbers
        Subject: Re: [PrimeNumbers] Brain Teaser



        I assume the numbers A, B and C are positive and different from 0.

        A = 2^a * r (r odd)
        B = 2^b * s (s odd)
        C = 2^c * t (t odd)
        sorted such that a <= b <= c

        S = AB + AC + BC = 2^(a+b)rs + 2^(a+c)rt + 2^(b+c)st
        = 2^(a+b) (rs + 2^(c-b)rt + 2^(c-a)st)

        1) If a < b < c, the highest power of 2 that divides S is 2^(a+b)

        2) If a = b = c, the highest power of 2 that divides S is 2^(2a)

        3) If 2 only are equal, say a = b, it comes

        S = 2^(a+a)rs + 2^(a+c)rt + 2^(a+c)st
        S = 2^(2a)rs + 2^(a+c+k)t(r+s)/2^k
        where 2^k is the highest power of 2 that divides (r+s),

        Once more, there are 3 cases:
        1) if (c+k) > a, the result is 2^(2a)
        2) if (c+k) < a, the result is 2^(a+c+k)
        3) if (c+k) = a, the result is 2^(2a+h) where 2^h is the greatest
        power of 2 that divides rs + t(r+s)/2^k

        Marcel Martin


        Unsubscribe by an email to: primenumbers-unsubscribe@egroups.com
        The Prime Pages : http://www.primepages.org



        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • Jon Perry
        Hey, you know you are right! Jon Perry perry@globalnet.co.uk http://www.users.globalnet.co.uk/~perry BrainBench MVP for HTML and JavaScript
        Message 3 of 13 , Oct 6, 2001
        • 0 Attachment
          Hey, you know you are right!

          Jon Perry
          perry@...
          http://www.users.globalnet.co.uk/~perry
          BrainBench MVP for HTML and JavaScript
          http://www.brainbench.com


          -----Original Message-----
          From: Marcel Martin [mailto:znz@...]
          Sent: 06 October 2001 09:30
          Cc: Prime Numbers
          Subject: Re: [PrimeNumbers] Brain Teaser



          >(c+k) becomes a+k = 1. a becomes what?
          >Say a becomes b=1. a+k=b, therefore 2^(0+1+1)=4
          >Say a becomes c=1. a+k=c, therefore 4 again.

          Are you serious?. To find 'what a becomes', it is sufficient to
          adapt the following equation to your particular case.

          ------------------------------------------
          S = 2^(a+b) rs + 2^(a+c) rt + 2^(b+c) st
          ------------------------------------------

          We have a < b and b = c
          S = 2^(a+b)rs + 2^(a+b)rt + 2^(2b)st
          S = 2^(a+b+k)r(s+t)/2^k + 2^(2b)st
          where 2^k is the highest power of 2 that divides (s+t)

          There are 3 cases:
          1) if (a+k) > b, the result is 2^(2b)
          2) if (a+k) < b, the result is 2^(a+b+k)
          3) if (a+k) = b, the result is 2^(2b+h) where 2^h is the greatest
          power of 2 that divides r(s+t)/2^k + st.

          Now, let's apply this to your numbers.

          A=2^0*5 -> a=0, r=5
          B=2^1*1 -> b=1, s=1
          C=2^1*5 -> c=1, t=5

          S = 2^(0+1)5 + 2^(0+1)25 + 2^2 5
          S = 2^(1+k)5(1+5)/2^k + 2^2 5 -> thus k = 1
          we are in the case a+k = b so the answer is 2^(2+h) with
          2^h dividing r(s+t)/2^k + st = 5(1+5)/2 + 5 = 20 -> 2^h = 4 -> h = 2

          The answer is 2^(2+h) = 2^4

          Marcel Martin


          Unsubscribe by an email to: primenumbers-unsubscribe@egroups.com
          The Prime Pages : http://www.primepages.org



          Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        • Jon Perry
          You have missed i=j
          Message 4 of 13 , Oct 6, 2001
          • 0 Attachment
            You have missed i=j<k.

            1) is true - I checked it in JScript (I'm working on the others).

            Jon Perry
            perry@...
            http://www.users.globalnet.co.uk/~perry
            BrainBench MVP for HTML and JavaScript
            http://www.brainbench.com


            -----Original Message-----
            From: MICHAEL HARTLEY [mailto:Michael.Hartley@...]
            Sent: 06 October 2001 04:26
            To: Jon Perry
            Cc: primenumbers@yahoogroups.com
            Subject: Re: [PrimeNumbers] Brain Teaser


            To: "Prime Numbers" <primenumbers@yahoogroups.com>
            From: "Jon Perry" <perry@...>
            Date sent: Thu, 4 Oct 2001 22:51:33 +0100
            Subject: [PrimeNumbers] Brain Teaser

            > Should be quite simple this one.
            >
            > What is the highest power of two that divides ab+bc+ca?
            >
            > e.g.a=1, b=2, c=3, ab+bc+ca=2+6+3=11, therefore 0.
            >
            > a=2,b=2,c=3 ab+bc+ca=4+6+6=16, therefore 4.

            Here's my (version 1) "solution":

            Let a, b, c be 2^i.s, 2^j.t, 2^k.u, where s,t,u are odd, and i <= j <= k

            1) If j < k or i=j=k:
            answer is i+j

            2) If i<j=k:
            Let t+u = 2^m.v, v is odd

            2.1) If i+m > j:
            Answer is 2j

            2.2) If i+m < j:
            Answer is i+j+m

            2.3) If i+m = j:
            Let sv+tu = 2^n.w, w is odd.
            Answer is 2j+n = i+j+m+n

            Messy... :-(

            Michael Hartley : Michael.Hartley@...
            Head, Department of Information Technology,
            Sepang Institute of Technology
            +---Q-u-o-t-a-b-l-e---Q-u-o-t-e----------------------------------
            "There was a young man from Peru,
            Whose limericks stopped at line two."
            -- Spike Milligan
          • Jon Perry
            Sorry - you haven t. Jon Perry perry@globalnet.co.uk http://www.users.globalnet.co.uk/~perry BrainBench MVP for HTML and JavaScript http://www.brainbench.com
            Message 5 of 13 , Oct 6, 2001
            • 0 Attachment
              Sorry - you haven't.

              Jon Perry
              perry@...
              http://www.users.globalnet.co.uk/~perry
              BrainBench MVP for HTML and JavaScript
              http://www.brainbench.com


              -----Original Message-----
              From: Jon Perry [mailto:perry@...]
              Sent: 06 October 2001 12:43
              To: MICHAEL HARTLEY
              Cc: primenumbers@yahoogroups.com
              Subject: RE: [PrimeNumbers] Brain Teaser


              You have missed i=j<k.

              1) is true - I checked it in JScript (I'm working on the others).

              Jon Perry
              perry@...
              http://www.users.globalnet.co.uk/~perry
              BrainBench MVP for HTML and JavaScript
              http://www.brainbench.com


              -----Original Message-----
              From: MICHAEL HARTLEY [mailto:Michael.Hartley@...]
              Sent: 06 October 2001 04:26
              To: Jon Perry
              Cc: primenumbers@yahoogroups.com
              Subject: Re: [PrimeNumbers] Brain Teaser


              To: "Prime Numbers" <primenumbers@yahoogroups.com>
              From: "Jon Perry" <perry@...>
              Date sent: Thu, 4 Oct 2001 22:51:33 +0100
              Subject: [PrimeNumbers] Brain Teaser

              > Should be quite simple this one.
              >
              > What is the highest power of two that divides ab+bc+ca?
              >
              > e.g.a=1, b=2, c=3, ab+bc+ca=2+6+3=11, therefore 0.
              >
              > a=2,b=2,c=3 ab+bc+ca=4+6+6=16, therefore 4.

              Here's my (version 1) "solution":

              Let a, b, c be 2^i.s, 2^j.t, 2^k.u, where s,t,u are odd, and i <= j <= k

              1) If j < k or i=j=k:
              answer is i+j

              2) If i<j=k:
              Let t+u = 2^m.v, v is odd

              2.1) If i+m > j:
              Answer is 2j

              2.2) If i+m < j:
              Answer is i+j+m

              2.3) If i+m = j:
              Let sv+tu = 2^n.w, w is odd.
              Answer is 2j+n = i+j+m+n

              Messy... :-(

              Michael Hartley : Michael.Hartley@...
              Head, Department of Information Technology,
              Sepang Institute of Technology
              +---Q-u-o-t-a-b-l-e---Q-u-o-t-e----------------------------------
              "There was a young man from Peru,
              Whose limericks stopped at line two."
              -- Spike Milligan



              Unsubscribe by an email to: primenumbers-unsubscribe@egroups.com
              The Prime Pages : http://www.primepages.org



              Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            • Phil Carmody
              ... Who is you ? ? uoy si ohW Haven t what? ?tahw t nevaH Please don t top post. .tsop pot t nod esaelP Phil
              Message 6 of 13 , Oct 6, 2001
              • 0 Attachment
                On Sat, 06 October 2001, "Jon Perry" wrote:
                >
                > Sorry - you haven't.
                >
                > Jon Perry
                > perry@...
                > http://www.users.globalnet.co.uk/~perry
                > BrainBench MVP for HTML and JavaScript
                > http://www.brainbench.com


                Who is 'you'? ?'uoy' si ohW
                Haven't what? ?tahw t'nevaH
                Please don't top post. .tsop pot t'nod esaelP

                Phil lihP

                -- --

                Phil lihP

                Please don't top post. .tsop pot t'nod esaelP
                Haven't what? ?tahw t'nevaH
                Who is 'you'? ?'uoy' si ohW


                Mathematics should not have to involve martyrdom;
                Support Eric Weisstein, see http://mathworld.wolfram.com
                Find the best deals on the web at AltaVista Shopping!
                http://www.shopping.altavista.com
              Your message has been successfully submitted and would be delivered to recipients shortly.