Generating Large Primes

Scientific Notebook does not have a built-in function to generate large primes, but the underlying computational system does. The following is an example of how to define Scientific Notebook functions that correspond to existing functions in the underlying computational system. (See the Appendix for a general discussion of how to access such functions.) In this example, p(x)is defined as the Scientific Notebook name for the Maple function, nextprime(x), which generates the next larger prime.


$\blacktriangleright$ To define p(x) as the next prime function

1.
From the Define submenu, choose Define Maple Name.dtbpF3.7663in2.4993in0ptdefmapnm.wmf

2.
Enter nextprime(x) as the Maple Name.

3.
Enter p(x) as the Scientific Notebook Name.

4.
Click OK. (Leave other options blank.)

Test the function using Evaluate.

$\blacktriangleright$ Evaluate

p(4) = 5

p(500) = 503

p(8298) = 8311

p$\left(\vphantom{ 273849728952758923}\right.$273849728952758923$\left.\vphantom{ 273849728952758923}\right)$ = 273 84972 89527 58939


\begin{example}
The
\index{RSA algorithm@RSA algorithm}Rivest-Shamir-Adleman ...
...limfunc{mod}n=29384737849576728375
\end{displaymath}
\medskip
\end{example}