Function reference · Special functions
nextprime
Returns the smallest prime greater than an integer.
Notation
nextprime(value)
Write it in an expression: nerdamer('nextprime(10)'), or in the Playground.
nerdamer.nextprime
nerdamer.nextprime(value: ExpressionInput): Expression
A method on the default import. Arguments can be strings, as in Notation.
Parameters
value- An integer. The result is always greater than it, even when
valueis prime.
Returns
The next prime, as an integer.
Examples
Good to know
- To split an integer into primes, use
factororpfactor.
JavaScript examples
nerdamer.nextprime(10).text()
// → 11