3
$\begingroup$

I want to find the numbers from all the integers list such that these will satisfy the condition. Ex:

Select[{1,3,8,9},#^3==27&]

But instead of giving {1,3,8,9} I want to give all the integers.

$\endgroup$
7
$\begingroup$

I think you want FindInstance:

FindInstance[x^3 == 27, x]
{{x -> 3}}

Although not necessary in this case you can restrict the domain with the third parameter, i.e. FindInstance[x^3 == 27, x, Integers].

| improve this answer | |
$\endgroup$
4
$\begingroup$

Why not simply

Solve[x^3 == 27, x, Integers]

{{x -> 3}}

?

| improve this answer | |
$\endgroup$
  • $\begingroup$ For some reason I had in mind a case with infinite solutions, but Solve is more direct here. In any case it seems we are guessing what the OP wants. $\endgroup$ – Mr.Wizard Dec 24 '16 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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