Skip to content
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
February 24, 2023 15:19
August 22, 2022 17:50
August 22, 2022 17:50
December 14, 2022 11:52
December 14, 2022 23:22
August 22, 2022 17:50
October 22, 2022 01:42
December 14, 2022 11:52
September 10, 2022 14:13
August 25, 2022 23:37
August 22, 2022 17:50
December 14, 2022 11:52
December 14, 2022 11:52

This set of C++ (https://en.wikipedia.org/wiki/C%2B%2B) programs must be run with GMP (https://en.wikipedia.org/wiki/GNU_Multiple_Precision_Arithmetic_Library, https://gmplib.org/)

This set of programs uses many number theoretic (https://en.wikipedia.org/wiki/Number_theory, https://www.rieselprime.de/ziki/Number_theory, https://mathworld.wolfram.com/NumberTheory.html) functions in GMP library (see https://gmplib.org/manual/Number-Theoretic-Functions), and we use the GMP function mpz_probab_prime_p (see https://faculty.lynchburg.edu/~nicely/misc/mpzspsp.html) to test the probable primality of the numbers, this function is combination of the Baillie–PSW probable primality test (https://en.wikipedia.org/wiki/Baillie%E2%80%93PSW_primality_test, https://mathworld.wolfram.com/Baillie-PSWPrimalityTest.html), the Miller–Rabin probable primality test (https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test, https://primes.utm.edu/glossary/xpage/MillersTest.html, https://www.rieselprime.de/ziki/Miller-Rabin_pseudoprimality_test, https://mathworld.wolfram.com/Rabin-MillerStrongPseudoprimeTest.html, http://www.numericana.com/answer/pseudo.htm#rabin, http://www.javascripter.net/math/primes/millerrabinprimalitytest.htm, http://ntheory.org/data/psps.txt) of first 50 prime bases (see https://oeis.org/A014233 and https://oeis.org/A141768 and https://oeis.org/A001262 and https://oeis.org/A074773) (we use reps = 50, thus the first 50 prime bases), and trial division (https://en.wikipedia.org/wiki/Trial_division, https://primes.utm.edu/glossary/xpage/TrialDivision.html, https://www.rieselprime.de/ziki/Trial_factoring, https://mathworld.wolfram.com/TrialDivision.html, http://www.numericana.com/answer/factoring.htm#trial) to about 109, thus all numbers in the data are Baillie–PSW probable primes (i.e. both strong probable primes to base 2 (see https://oeis.org/A001262) and strong Lucas pseudoprimes (https://en.wikipedia.org/wiki/Lucas_pseudoprime#Strong_Lucas_pseudoprimes, https://mathworld.wolfram.com/StrongLucasPseudoprime.html, http://ntheory.org/data/slpsps-baillie.txt) with parameters (P, Q) defined by Selfridge's Method A (see https://oeis.org/A217255)), i.e. either primes or Baillie–PSW pseudoprimes, and no known composites which pass the Baillie–PSW probable prime test, and no composites < 264 pass the Baillie–PSW probable prime test (see http://ntheory.org/pseudoprimes.html and https://faculty.lynchburg.edu/~nicely/misc/bpsw.html), thus if a number in the data is in fact composite, it will be a pseudoprime to the Baillie–PSW probable prime test, which currently no single example is known!

The program "searchpp.cc" is searching the smallest (probable) prime in non-simple families (for the examples of non-simple families, see https://stdkmd.net/nrr/prime/primecount3.htm and https://stdkmd.net/nrr/prime/primecount3.txt (only base 10 families)), non-simple families usually have small primes if they cannot be ruled out as only containing composites by covering congruence, see the README file in the main page.

(the section below uses the notation in http://www.cs.uwaterloo.ca/~shallit/Papers/minimal5.pdf (cached copy at https://github.com/xayahrainie4793/pdf-files-cached-copy/blob/main/pdf_11.pdf), i.e. "XY" means "X is a subsequence of Y")

e.g. for the non-simple family {7}{4}1 in base b = 8, we can separate it to these families:

and thus we found that the smallest prime in the non-simple family {7}{4}1 in base 8 is 77774444441

For another example, for the non-simple family {8}{3}5 in base b = 9, we can separate it to these families:

and thus we found that the smallest prime in the non-simple family {8}{3}5 in base 9 is 8333333335

The program "searchpm.cc" is searching the smallest (probable) prime in simple families up to length 1000.

The program "searchp1.cc" is searching the smallest (probable) prime in simple families extensively, starting with length 1000.

The program "searchLLR.cc" is a sieving (https://www.rieselprime.de/ziki/Sieving, https://www.rieselprime.de/ziki/Sieving_a_range_of_sequences, https://mathworld.wolfram.com/Sieve.html, http://www.rechenkraft.net/yoyo/y_status_sieve.php) program like SRSIEVE (https://www.bc-team.org/app.php/dlext/?cat=3, http://web.archive.org/web/20160922072340/https://sites.google.com/site/geoffreywalterreynolds/programs/, http://www.rieselprime.de/dl/CRUS_pack.zip, https://primes.utm.edu/bios/page.php?id=905, https://www.rieselprime.de/ziki/Srsieve, https://github.com/xayahrainie4793/prime-programs-cached-copy/tree/main/srsieve_1.1.4, https://github.com/xayahrainie4793/prime-programs-cached-copy/tree/main/sr1sieve_1.4.6, https://github.com/xayahrainie4793/prime-programs-cached-copy/tree/main/sr2sieve_2.0.0, https://github.com/xayahrainie4793/prime-programs-cached-copy/tree/main/srbsieve, https://github.com/xayahrainie4793/prime-programs-cached-copy/blob/main/mtsieve_2.4.1/srsieve2.exe, https://github.com/xayahrainie4793/prime-programs-cached-copy/blob/main/mtsieve_2.4.1/srsieve2cl.exe) but only sieved to the prime 130337 (while SRSIEVE usually sieve to 109 or more) and not remove the numbers with algebraic factors (see https://mersenneforum.org/showpost.php?p=452132&postcount=66 and https://mersenneforum.org/showthread.php?t=21916 and https://github.com/xayahrainie4793/prime-programs-cached-copy/blob/main/srsieve_1.1.4/algebraic.c (note: for the sequence (a×bn+c)/gcd(a+c,b−1), the case of "Mersenne number" in https://github.com/xayahrainie4793/prime-programs-cached-copy/blob/main/srsieve_1.1.4/algebraic.c is the case which a is rational power of b, c = −1 and the case which a is rational power of b, c = 1, gcd(a+c,b−1) ≥ 3, and the case of "GFN" in https://github.com/xayahrainie4793/prime-programs-cached-copy/blob/main/srsieve_1.1.4/algebraic.c is the case which a is rational power of b, c = 1, gcd(a+c,b−1) is either 1 or 2)), and the program "searchLLR.cc" prints the LLR (http://jpenne.free.fr/index2.html, https://primes.utm.edu/bios/page.php?id=431, https://www.rieselprime.de/ziki/LLR, https://github.com/xayahrainie4793/prime-programs-cached-copy/tree/main/llr403win64, https://github.com/xayahrainie4793/prime-programs-cached-copy/tree/main/llr403linux64) input file and thus the LLR program must be used after the program "searchLLR.cc".

There is also a Pari/GP (https://pari.math.u-bordeaux.fr/) program code to compute the first few minimal primes (say < 232) in base b (this program looks at all primes one by one, to test whether a prime is a minimal prime or not, and has time complexity (https://en.wikipedia.org/wiki/Time_complexity) O(n) when compute the minimal primes ≤ n (where O is the big O notation (https://en.wikipedia.org/wiki/Big_O_notation, https://primes.utm.edu/glossary/xpage/BigOh.html, https://mathworld.wolfram.com/Big-ONotation.html)), thus this program would need a time longer than the age of the universe (https://en.wikipedia.org/wiki/Age_of_the_universe) to test to the largest minimal prime for base b = 10 (i.e. 5000000000000000000000000000027), even if we can test 106 primes per second (https://en.wikipedia.org/wiki/Second)), hence to do this is impractically, not to mention base b = 24, whether the set of the C++ programs in this page has time complexity (https://en.wikipedia.org/wiki/Time_complexity) O(log(n)3) (where log is the natural logarithm (https://en.wikipedia.org/wiki/Natural_logarithm, https://primes.utm.edu/glossary/xpage/Log.html, https://mathworld.wolfram.com/NaturalLogarithm.html)) when compute the minimal primes ≤ n, thus it has a polynomial time (https://en.wikipedia.org/wiki/Time_complexity#Polynomial_time, https://mathworld.wolfram.com/PolynomialTime.html)):

a(n,k,b)=v=[];for(r=1,length(digits(n,b)),if(r+length(digits(k,2))-length(digits(n,b))>0 && digits(k,2)[r+length(digits(k,2))-length(digits(n,b))]==1,v=concat(v,digits(n,b)[r])));fromdigits(v,b)

g(n)=if(n<10,n+48,n+55)

f(n,b)=for(k=1,length(digits(n,b)),print1(Strchr(g(digits(n,b)[k]))))

is(n,b)=for(k=1,2^length(digits(n,b))-2,if(ispseudoprime(a(n,k,b)) && a(n,k,b)>=b+1,return(0)));1

c(b)=forprime(p=b+1,2^32,if(is(p,b),f(p,b);print1(", ")))