February 2020
Beginner
621 pages
19h 34m
English
Suppose you need to find a large random prime of 50 digits. Here is one way. The function NextPrime[x] finds the next prime greater than . The function Random[Integer,{a,b}] gives a random integer between and . Combining these, we can find a prime:
In[1]:= NextPrime[Random[Integer, {, }]]
Out[1]= 73050570031667109175215303340488313456708913284291
If we repeat this procedure, we should get another prime:
In[2]:= NextPrime[Random[Integer, {, }]]
Out[2]= 97476407694931303255724326040586144145341054568331
Suppose you want to change the text hellohowareyou to numbers:
In[3]:= txt2num1["hellohowareyou"]
Out[3]= 805121215081523011805251521
Note that we are now using ...
Read now
Unlock full access