Skip to content

Instantly share code, notes, and snippets.

@mrpapercut
Last active December 5, 2022 09:59
Show Gist options
  • Save mrpapercut/a49531fa6eb0e3007d433188c3d2874b to your computer and use it in GitHub Desktop.
Save mrpapercut/a49531fa6eb0e3007d433188c3d2874b to your computer and use it in GitHub Desktop.

Running PRP tests

Let's say you want to find all PRPs with the form k^n+n for k = 6 and n < 10000

1. Download PFGW

https://sourceforge.net/projects/openpfgw/

2. Generate a sieve file

Go to https://pinetools.com/generate-list-numbers

In our example, you would fill in the following:

First number: 1
Last number: 10000
Step: 2

In this example, all even number n will not result in a prime, so you can only check the odd numbers

3. Create a sieve file

Create a new textfile where the first line says exactly this:

ABC 6^$a+$a

Then copy the full list of numbers into this file so that each number is on a separate line

Note: If you want to test something more complicated like a+2^b+c, you would use

ABC $a+2^$b+$c

4. Run PFGW

Now in commandline, run the following command:

pfgw64.exe sieve-file.txt -l"sieve-file-output.log"

All results are printed to the screen, but also saved in sieve-file-output.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment