Jump to content
BrainDen.com - Brain Teasers
  • 0


superprismatic
 Share

Question

I found this puzzle on the ITA

Software web site. It is one of

ITA's "retired" puzzles. The

web site does not give the answer.

I suppose the puzzle is difficult

enough to require writing a program

to solve it. I thought programming

this was quite a little tricky but

fun as well. I have an answer but

bugs have been known to creep into

my code. I hope you enjoy it.

Here it is:

Combining nine 9s with any number of

the operators +, -, *, /, (, ) , what

is the smallest positive integer that

cannot be expressed?

Hints:

1)The answer isn't zero. You can

express zero like this:

(9 - 9) * (9 + 9 + 9 + 9 + 9 + 9 + 9)

Also, zero isn't a positive integer.

2)The answer isn't one. You can

express one like this:

9 - (9 * 9 - 9)/9 + 9 - 9 + 9 - 9

3)It's not a trick question.

4)Be sure to handle parentheses

correctly.

Notes:

1)You cannot exponentiate.

2)You cannot concatenate (for example,

put two 9s together to make 99).

3)The - operator can be used in either

its binary or unary form.

4)Assume base 10.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Thanks a bundle, SP, especially since I am just going to bed. My immediate and obvious answer must be incorrect, and so I must think of something subtler.

Edited by jerbil
Link to comment
Share on other sites

  • 0

2 =((9+9)/9+(9+9)/9)/((9+9)/9)

3 =((9+9+9)/9+(9-9)/9)+((9-9)/9)

4 =(9+9)/9+(9+9)/9-(9-9)/9

5 =((9+9+9)/9+(9+9)/9)+((9-9)/9)

6 =((9+9)/9+(9+9)/9)+((9+9)/9)

7 =((9*9)/9-(9+9)/9)+((9-9)/9)

8 =((9+9)/9*(9+9)/9)*(9+9)/9

9 =9+9+9+9+9-9-9-9-9

10 =9*9/9+9/9+(9-9)/9

11 =((9*9)/9+(9+9)/9)-((9-9)/9)

12 =9*9/9+9/9+(9+9)/9

13 =9*9/9+(9+9)/9+(9+9)/9

14 =9*9/9+(9+9+9+9+9)/9

15 =-(9+9+9)/9+9+9+(9-9)/9

16 =((9*9*9)/(9*9)-(9+9)/9)+9

17 =-(9+9)/9+9+9+(9-9+9)/9

18 =9+9-9/9+9/9+9/9-9/9

19 =9+9+(9+9)/9-9/9+9-9

20 =((9*9*9)/(9*9)+(9+9)/9)+9

Link to comment
Share on other sites

  • 0

I'm trying to write a program for this one. At the moment its looking like 4 billion combinations. Most of these will be repeated combinations but I haven't found a way eliminate that yet. It's looking like it will take several minutes of processing time at best.

Link to comment
Share on other sites

  • 0

My answer is 41 but I think that's just because there are tricks to manipulating the 9's that I haven't been able to figure out. Any help?

Edited by Tuckleton
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...