All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Making integer an expression (Posted on 2009-03-20)
Find all positive integers n which make the expression below an integer:

(25/2 + (625/4 - n)½ )½ + (25/2 - (625/4 - n)½ )½

 See The Solution Submitted by pcbouhid Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 5 of 12 |

QuickBasic, of course, stops as soon as it tries to take the square root of a negative number, but UBASIC takes it in stride:

`list   10     for N=1 to 10000   20      V=sqrt(25/2+sqrt(625/4-N))+sqrt(25/2-sqrt(625/4-N))   30      D=abs(V-int(V))   40      if D>0.99999 or D<0.00001 then print N,V   50     next   60     endOKrun 144     7.0 784     8.9999999999999999998 2304    10.9999999999999999998 5184    12.9999999999999999998 10000   14.9999999999999999998OK`

Of course the rounding errors lead to those almost-integers that really should be integers.

In each case n is an integer and the result is an integer, so I see nothing wrong with all of them counting as solutions ad infinitum.

 Posted by Charlie on 2009-03-20 15:43:58

 Search: Search body:
Forums (0)