1
$\begingroup$

I am trying to find the total number of solutions to: Floor[x]*Ceiling[x]=x^2 between 0 and 100

Now when we do this for Integers, it's just fine with a 100 result:

FindInstance[
 Floor[x]*Ceiling[x] == x^2 && 0 < x <= 100 , {x}, Integers, 200]

Now why does it not work for Reals?

When I put mx of 200, it only gives me 1 random solution of 63 with the typical warning "Warning: FindInstance found only 1 instance(s), but it was not able to prove 200 instances do not exist."

FindInstance[
 Floor[x]*Ceiling[x] == x^2 && 0 < x <= 100 , {x}, Reals, 200]

But if I down the limit to 20, then it gives a series of solutions with #1's (what does that even mean)?

Any way to make this right to gove a full solution?

Thanks!

$\endgroup$
3
  • $\begingroup$ Try command: ?Root ? $\endgroup$ Commented May 8 at 7:05
  • $\begingroup$ It works in MMA version 14.0 $\endgroup$ Commented May 8 at 7:06
  • $\begingroup$ version 12.2, 13.3.1,14.0 works but 11.3 not. $\endgroup$
    – cvgmt
    Commented May 8 at 7:09

1 Answer 1

2
$\begingroup$
$MaxPiecewiseCases = 200;
Solve[Floor[x]*Ceiling[x] == x^2 && 0 < x <= 100, x]
Length[%]

{{x -> 1}, {x -> 2}, ... , {x -> Sqrt[8742]}, {x -> Sqrt[8930]}}

199
$\endgroup$
1
  • $\begingroup$ Thank you so much! Sorry I was away for a while.... $\endgroup$
    – Steve237
    Commented May 16 at 1:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.