Using mathematical functions
169
isprime
Prime integer test. Returns 1 if the integer
a
is prime;
otherwise, returns 0.
isprime
(
a
)
Example:
isprime
(1999) returns 1.
ithprime
Nth prime. For the integer
n
, returns the nth prime number
less than 10,000.
ithprime
(
n
)
Example:
ithprime
(5) returns 11.
nextprime
Next prime. Returns the next prime number after the
integer a.
nextprime
(
a
)
Example:
nextprime
(11) returns 13.
powmod
Power and modulo. For the integers
a
,
n
, and
p
, returns
mod
p
.
powmod
(
a, n, p
)
Example:
powmod
(5, 2, 13) returns 12.
prevprime
Previous prime. Returns the previous prime number before
the integer a.
prevprime
(
a
)
Example:
prevprime
(11) returns 7.
euler
Euler's phi (or totient) function. Takes a positive integer x
and returns the number of positive integers less than or
equal to x that are coprime to x.
euler
(
x
)
Example:
euler
(6) returns 2.
a
n
Summary of Contents for 39gII
Page 1: ...HP 39gII graphing calculator user s guide Edition1 Part Number NW249 90001 ...
Page 2: ...Printing History Edition 1 November 201 1 ...
Page 32: ...22 Getting started ...
Page 58: ...48 Apps and their views ...
Page 70: ...60 Function app ...
Page 80: ...70 Solve app ...
Page 136: ...126 Polar app ...
Page 140: ...130 Sequence app ...
Page 148: ...138 Finance app ...
Page 152: ...142 Linear Solver app ...
Page 218: ...208 Matrices ...
Page 226: ...216 Notes and Info ...
Page 238: ...228 Variables and memory management ...
Page 318: ...308 Programming ...
Page 340: ...330 Reference information ...
Page 346: ...vi Product Regulatory Information ...