Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 6
    $\begingroup$ You're probably using = (assignment) instead of == (equality). $\endgroup$ Commented Jan 28, 2020 at 6:33
  • $\begingroup$ Thanks for the comment, at first I did that and I think the message error was the same, but then corrected it and happened this. The answer below solved it, though I end up using a "while" loop to solve it iteratively, which happened to be much much quicker (not sure why) - and which did not require to specify an upper bound for x. $\endgroup$ Commented Jan 29, 2020 at 0:45
  • 3
    $\begingroup$ The reason why the problem didn't go away after you changed = to == was probably that you did not clear/quit the kernel, and so the previous definition was still lingering in the background (Mathematica doesn't forget anything unless you tell it to). With ?x you can find out what definitions are associated with x. $\endgroup$ Commented Jan 29, 2020 at 7:00