sci-pi.org.uk on Pis
Once the initial installation of Raspbian has completed, which seems to take around 20 minutes on a Pi 4, one should find that everything one needs is installed.
(The above might not be true for the beta 64 bit version of Raspberry Pi OS. In which case,
$ sudo apt-get install python3-matplotlib python3-cairo python3-numba python3-gi-cairo
The differences between the various Pi models are mostly in speed and memory capacity, and the software should behave in the same way on all.
Users of small, old, Pis might like to use
nano as a
text editor. This should be started from a terminal window.
$ curl -O http://www.sci-pi.org.uk/maths/mersenne_fast.py $ chmod +x mersenne_fast.py $ nano mersenne_fast.py
It has a friendly status line at the bottom reminding one of the major commands available by pressing the control key (Ctrl, represented by ^) with a given letter.
Those wishing to launch a light-weight GUI editor from the terminal can try
$ mousepad mersenne_fast.py &
Here the final & allows the shell's command prompt to return before the application finishes, so that one can continue to use the terminal window whilst the editor is running. It seems that mousepad produces four GTK warnings every time it is started, so it may be best to keep a copy running and not restart it very often, unless one likes reading warning messages.
mersenne_fast.py file as downloaded tests all
Mersenne numbers from 3 (
p=3) to 3300
p<3300). Using the editor one could change this to the
range 4201 to 4450 (note that the starting number must be odd). Two
more Mersenne primes should be found in that range.
Much of the code quoted on these web pages doubles as a link to a downloadable version. These can be used as follows:
- Right-click on the code, and select "copy link address"
- In a terminal window, type "
curl -O" then click the middle mouse button to paste in the link contents
chmod +xfollowed by the filename just downloaded
./followed by the filename just downloaded (no space, unlike the preceding two commands