File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programming Diversions and the fly likes Nine 4s to make 2000 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Nine 4s to make 2000" Watch "Nine 4s to make 2000" New topic
Author

Nine 4s to make 2000

Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Now that we are beginning to get the hang of these...
Fill in the operators for the following equation. You may use any operators you wish. There should be at least three different ways to solve this equation.
4 4 4 4 4 4 4 4 4 = 2000
Typical operations that may be used include multiplication, division, addition, subtraction, exponentiation, square roots, factorials, and parens for grouping. Additionally you can squeeze numbers together, so using the above equation, 4, 44, and 444 (to name a few) would be legal.
Roy Tock
Ranch Hand

Joined: Jul 16, 2001
Posts: 83
I take it this is illegal?
4+4+4+4+4+4+4-4-4 = 20+0+0
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Roy Tock:
I take it this is illegal?
4+4+4+4+4+4+4-4-4 = 20+0+0

You are correct, it is not legal. The equation must evaluate to 2000.
Roy Tock
Ranch Hand

Joined: Jul 16, 2001
Posts: 83
Perhaps more satisfying...
(444-44)*( (sqrt(4)*sqrt(4)) + (4/4) )
George Harris
Ranch Hand

Joined: May 05, 2003
Posts: 84
How about (4*4^4) + (4*4^4) - 44 - 4
George Harris
Ranch Hand

Joined: May 05, 2003
Posts: 84
An easier approach : 4*(444 + 44) + 44 + 4
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Hopefully this one's OK
(4 ^ 4) * (4 + 4) - (4 * 4 * (4 - 4 / 4))
Gurwinder Singh
Greenhorn

Joined: Jul 31, 2003
Posts: 1
Here is another one.
(4! + (4/4)) *4 *(4+4+4+4+4) = (24+1)*4*20 = 2000
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Nine 4s to make 2000