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
  • 2
    $\begingroup$ Welcome to Mathematica.SE, Robert. What have you tried? It is preferable if you show some effort in working out your problem for yourself, and give some indication of where you got stuck. Please see the FAQ for more details. $\endgroup$ Commented Jan 18, 2013 at 3:42
  • $\begingroup$ Are you looking for any one way to implement it or do you want to know how it is actually implemented? $\endgroup$ Commented Jan 18, 2013 at 4:44
  • $\begingroup$ What Szabolcs means to say is... NextPrime IS actually implemented in Mathematica. Try Trace[NextPrime[6]]. The core of it is quite similar to what I posted $\endgroup$ Commented Jan 18, 2013 at 4:48