Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Math Puzzle

Math Puzzle

Scheduled Pinned Locked Moved The Lounge
question
30 Posts 13 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Shree

    How can you write any positive integer using only three 2s and any mathematical operations?

    P Offline
    P Offline
    Phil Martin
    wrote on last edited by
    #2

    Too hard for this black duck! I can do 1, 2, 3, 6, 8, but thats pretty much it. Unless it is one of those lateral thinking ones, I'm stumped!

    1 Reply Last reply
    0
    • S Shree

      How can you write any positive integer using only three 2s and any mathematical operations?

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #3

      How about the absolute value of the three two's with your choice of operation? If I am wrong I am blaming it on being tired. Off to get some :zzz: -Nick Parker

      1 Reply Last reply
      0
      • S Shree

        How can you write any positive integer using only three 2s and any mathematical operations?

        D Offline
        D Offline
        Dominik Reichl
        wrote on last edited by
        #4

        You cannot write any positive integer this way. You can perhaps write the first 10 or so this way, but not all. How do you want to express 12389757325795825925782958752334789 only with [edit]three[/edit] 2s? :-D -Dominik


        _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

        R 1 Reply Last reply
        0
        • S Shree

          How can you write any positive integer using only three 2s and any mathematical operations?

          A Offline
          A Offline
          Atlantys
          wrote on last edited by
          #5

          The largest number I can do is: 4194304 (2^22). But, you want ANY positive number.... and only 3 twos.. not 4 twos.. or 5 twos, just 3? I strongly doubt it. Then again, I have been known to be wrong, from time to time. ;P I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]

          D R 2 Replies Last reply
          0
          • A Atlantys

            The largest number I can do is: 4194304 (2^22). But, you want ANY positive number.... and only 3 twos.. not 4 twos.. or 5 twos, just 3? I strongly doubt it. Then again, I have been known to be wrong, from time to time. ;P I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]

            D Offline
            D Offline
            Dominik Reichl
            wrote on last edited by
            #6

            Atlantys wrote: The largest number I can do is: 4194304 (2^22). There is a larger number :-D:-D:-D -Dominik


            _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

            1 Reply Last reply
            0
            • D Dominik Reichl

              You cannot write any positive integer this way. You can perhaps write the first 10 or so this way, but not all. How do you want to express 12389757325795825925782958752334789 only with [edit]three[/edit] 2s? :-D -Dominik


              _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

              R Offline
              R Offline
              Ryan Binns
              wrote on last edited by
              #7

              Dominik Reichl wrote: How do you want to express 12389757325795825925782958752334789 only with [edit]three[/edit] 2s? Easy. 2 big, 2 long, 2 difficult to remember :)

              Ryan

              "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

              D 1 Reply Last reply
              0
              • R Ryan Binns

                Dominik Reichl wrote: How do you want to express 12389757325795825925782958752334789 only with [edit]three[/edit] 2s? Easy. 2 big, 2 long, 2 difficult to remember :)

                Ryan

                "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                D Offline
                D Offline
                Dominik Reichl
                wrote on last edited by
                #8

                Ryan Binns wrote: Easy. 2 big, 2 long, 2 difficult to remember :laugh::laugh::laugh: -Dominik


                _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

                1 Reply Last reply
                0
                • A Atlantys

                  The largest number I can do is: 4194304 (2^22). But, you want ANY positive number.... and only 3 twos.. not 4 twos.. or 5 twos, just 3? I strongly doubt it. Then again, I have been known to be wrong, from time to time. ;P I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]

                  R Offline
                  R Offline
                  Ryan Binns
                  wrote on last edited by
                  #9

                  Atlantys wrote: The largest number I can do is: 4194304 (2^22) Really?! What about 222! = approx 1.12*10426

                  Ryan

                  "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                  D X L A 5 Replies Last reply
                  0
                  • R Ryan Binns

                    Atlantys wrote: The largest number I can do is: 4194304 (2^22) Really?! What about 222! = approx 1.12*10426

                    Ryan

                    "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                    D Offline
                    D Offline
                    Dominik Reichl
                    wrote on last edited by
                    #10

                    An even larger number exists :-D:-D -Dominik


                    _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

                    1 Reply Last reply
                    0
                    • R Ryan Binns

                      Atlantys wrote: The largest number I can do is: 4194304 (2^22) Really?! What about 222! = approx 1.12*10426

                      Ryan

                      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                      D Offline
                      D Offline
                      Dominik Reichl
                      wrote on last edited by
                      #11

                      Umm, how many operators may I use? Because if I have an infinite number of operators, I can make an infinite long number... Btw, the number I thought of before was ((2 << 22)!) Where << is binary left shift. Now if I have an infinite number of operators, why not make (((((((((((((2 << 22)!)!)!)!)!)!)!)!)!)!)!)!) ... :confused: -Dominik


                      _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

                      R 1 Reply Last reply
                      0
                      • R Ryan Binns

                        Atlantys wrote: The largest number I can do is: 4194304 (2^22) Really?! What about 222! = approx 1.12*10426

                        Ryan

                        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                        X Offline
                        X Offline
                        xxrl
                        wrote on last edited by
                        #12

                        ghost!;) You are the best!Me too!

                        1 Reply Last reply
                        0
                        • D Dominik Reichl

                          Umm, how many operators may I use? Because if I have an infinite number of operators, I can make an infinite long number... Btw, the number I thought of before was ((2 << 22)!) Where << is binary left shift. Now if I have an infinite number of operators, why not make (((((((((((((2 << 22)!)!)!)!)!)!)!)!)!)!)!)!) ... :confused: -Dominik


                          _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

                          R Offline
                          R Offline
                          Ryan Binns
                          wrote on last edited by
                          #13

                          Aah yes, but the goal of the problem is to specify any number using three 2's and any mathematical operators, not necessarily the largest number. Say the number is n, then n = 2log2(n), but I'm not sure if this is what is wanted. Any number can be represented by either 2n or 2n+2/2, but again I'm not sure if this is what is wanted. I dunno. I'm working on it :)

                          Ryan

                          "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                          1 Reply Last reply
                          0
                          • R Ryan Binns

                            Atlantys wrote: The largest number I can do is: 4194304 (2^22) Really?! What about 222! = approx 1.12*10426

                            Ryan

                            "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                            L Offline
                            L Offline
                            Ludvig A Norin
                            wrote on last edited by
                            #14

                            Well then, try (2^22)! .... that ought to be quite big. Btw. the question was how to write any number, not the biggest... Part of the non-smoking generation since 12/5-2003 22.35.
                            -- Opinions expressed do not neccecarily reflect those of my -- employer; I do think for myself. Resisting temptation is -- easier when you think you'll maybe get another chance -- later on.

                            R 1 Reply Last reply
                            0
                            • L Ludvig A Norin

                              Well then, try (2^22)! .... that ought to be quite big. Btw. the question was how to write any number, not the biggest... Part of the non-smoking generation since 12/5-2003 22.35.
                              -- Opinions expressed do not neccecarily reflect those of my -- employer; I do think for myself. Resisting temptation is -- easier when you think you'll maybe get another chance -- later on.

                              R Offline
                              R Offline
                              Ryan Binns
                              wrote on last edited by
                              #15

                              Ludvig A. Norin wrote: Btw. the question was how to write any number, not the biggest... Yes I know. I was just surprised he couldn't get anything bigger :). See my reply to Dominik above :)

                              Ryan

                              "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                              1 Reply Last reply
                              0
                              • S Shree

                                How can you write any positive integer using only three 2s and any mathematical operations?

                                J Offline
                                J Offline
                                Joaquin M Lopez Munoz
                                wrote on last edited by
                                #16

                                0 is simple, so is 1. For the rest: n=-log2[log2(sqrt(sqrt(...n times...(2)...))))] Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                                J C R B S 5 Replies Last reply
                                0
                                • J Joaquin M Lopez Munoz

                                  0 is simple, so is 1. For the rest: n=-log2[log2(sqrt(sqrt(...n times...(2)...))))] Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                                  J Offline
                                  J Offline
                                  Jorgen Sigvardsson
                                  wrote on last edited by
                                  #17

                                  You have a degree in mathematics, don't you? :) -- I am on fire. Do you need a light?

                                  J 1 Reply Last reply
                                  0
                                  • J Joaquin M Lopez Munoz

                                    0 is simple, so is 1. For the rest: n=-log2[log2(sqrt(sqrt(...n times...(2)...))))] Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                                    C Offline
                                    C Offline
                                    carrie
                                    wrote on last edited by
                                    #18

                                    haha, absolute genius :)

                                    1 Reply Last reply
                                    0
                                    • J Joaquin M Lopez Munoz

                                      0 is simple, so is 1. For the rest: n=-log2[log2(sqrt(sqrt(...n times...(2)...))))] Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                                      R Offline
                                      R Offline
                                      Ryan Binns
                                      wrote on last edited by
                                      #19

                                      Well done :)

                                      Ryan

                                      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                                      1 Reply Last reply
                                      0
                                      • J Joaquin M Lopez Munoz

                                        0 is simple, so is 1. For the rest: n=-log2[log2(sqrt(sqrt(...n times...(2)...))))] Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                                        B Offline
                                        B Offline
                                        Brad Jennings
                                        wrote on last edited by
                                        #20

                                        Genius!:) Brad Jennings "You're mom is nice. Mind if I go out with her?" - Jörgen Sigvardsson

                                        1 Reply Last reply
                                        0
                                        • J Joaquin M Lopez Munoz

                                          0 is simple, so is 1. For the rest: n=-log2[log2(sqrt(sqrt(...n times...(2)...))))] Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

                                          S Offline
                                          S Offline
                                          Shree
                                          wrote on last edited by
                                          #21

                                          That's it!!

                                          W 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups