chiark / gitweb /
Merge branch '2.4.x' into 2.5.x
[catacomb] / math / t / pgen
1 # Test vectors for prime number finder
2
3 pgen {
4   2 2;
5   3 3;
6   245 251;
7
8   4294967295 4294967311;
9
10   # --- These can take a little while ---
11
12   498459898455435345676576789 498459898455435345676576793;
13   40831929843180254171317254073271577309351168965431122042755102715326515941762786951037109689522493525769 40831929843180254171317254073271577309351168965431122042755102715326515941762786951037109689522493526197;
14   166359567317705838255275971708060308423814413741683015010175247351623188739655446196925981468626681882384215574706593049022467680136399439302347043107836749816290369600677730213469006507173065402294688841278559283358390567733443050775707749725690534182003442070447739085348456478911335969765393755383551520173 166359567317705838255275971708060308423814413741683015010175247351623188739655446196925981468626681882384215574706593049022467680136399439302347043107836749816290369600677730213469006507173065402294688841278559283358390567733443050775707749725690534182003442070447739085348456478911335969765393755383551520257;
15 }
16
17 pgen-granfrob {
18   5 0 0 -1;
19   7 0 0 4;
20   15 0 0 3;
21   5777 1 -1 4; # pseudoprime
22   40301809 0 0 4;
23   86059163416987297647409667483582114939806237974424324409828198660056356336227 1 5 4;
24   102508420970861015999300753620309481186457893679971500520427161277511389396803 1 5 4;
25   72291866454056552194087337607224612505157525245486245416393486917859196707519 1 5 4;
26   72291866454056552194087337607224612505157525245486265416393486917859196707519 1 5 3;
27
28   ## A large Frobenius pseudoprime: call the first number p_1; then p_2 = 31
29   ## (p_1 + 1) - 1 and p_3 = 43 (p_1 + 1) - 1.  These three are all prime.
30   ## Their product is a strong Lucas, and Frobenius, pseudoprime.
31   ##
32   ## See `Prime and Prejudice' by Martin R. Albrecht, Jake Massimo, Kenneth
33   ## G. Paterson, and Juraj Somorovsky.
34   3690125385954346893658786222051913500627130245213169388019826598097107079718295481926241398412699320815932808015860263240282855670239765686869973444864115322609857375876438922226372746215468824202413623127 0 0 4;
35   114393886964584753703422372883609318519441037601608251028614624541010319471267159939713483350793678945293917048491668160448768525777432736292969176790787575000905578652169606589017555132679533550274822316967 0 0 4;
36   158675391596036916427327807548232280526966600544166283684852543718175604427886705722828380131746070795085110744681991319332162793820309924535408858129156958872223867162686873655734028087265159440703785794503 0 0 4;
37   66981291792500223036804182765508448534715465524671325885174850970812009004775815201151227900130153990294748113034471984909912807896550069799856170439734910206802409847773026240559371480115711600866989845251707737806461503879250232804362190067578216069266197879151809743235261582813331022213587929425243163096486125825510076936556242805690400001899138503900919499414951069309064408305196756524628693684938044145785145327821174180933033293089394794328963673467918652042794300291355500468079109432376296868174257674548727592142782202898031102246775544402811199608266683925072825828225074019194302318324623049819212337927 0 0 4;
38 }
39
40 primep {
41   -5 0;
42   -1 0;
43   0 0;
44   1 0;
45   2 1;
46   3 1;
47   4 0;
48   40301809 1;
49   40301811 0;
50
51   ## A small Lucas pseudoprime: 5777 = 53*109.
52   5777 0;
53
54   ## A large strong pseudoprime: this is the product of
55   ##
56   ##   p_1 = 142445387161415482404826365418175962266689133006163
57   ##   p_2 = 5840260873618034778597880982145214452934254453252643
58   ##   p_3 = 14386984103302963722887462907235772188935602433622363
59   ##
60   ## See `Prime and Prejudice' by Martin R. Albrecht, Jake Massimo, Kenneth
61   ## G. Paterson, and Juraj Somorovsky.
62   142445387161415482404826365418175962266689133006163 1;
63   5840260873618034778597880982145214452934254453252643 1;
64   14386984103302963722887462907235772188935602433622363 1;
65   11968794224604718293549908104759518204343930652759288592987578098131927050572705181539873293848476235393230314654912729920657864630317971562727057595285667 0;
66
67   ## A large Lucas pseudoprime: call the first number p_1; then p_2 = 31 (p_1
68   ## + 1) - 1 and p_3 = 43 (p_1 + 1) - 1.  These three are all prime.  Their
69   ## product is a strong Lucas pseudoprime.
70   3690125385954346893658786222051913500627130245213169388019826598097107079718295481926241398412699320815932808015860263240282855670239765686869973444864115322609857375876438922226372746215468824202413623127 1;
71   114393886964584753703422372883609318519441037601608251028614624541010319471267159939713483350793678945293917048491668160448768525777432736292969176790787575000905578652169606589017555132679533550274822316967 1;
72   158675391596036916427327807548232280526966600544166283684852543718175604427886705722828380131746070795085110744681991319332162793820309924535408858129156958872223867162686873655734028087265159440703785794503 1;
73   66981291792500223036804182765508448534715465524671325885174850970812009004775815201151227900130153990294748113034471984909912807896550069799856170439734910206802409847773026240559371480115711600866989845251707737806461503879250232804362190067578216069266197879151809743235261582813331022213587929425243163096486125825510076936556242805690400001899138503900919499414951069309064408305196756524628693684938044145785145327821174180933033293089394794328963673467918652042794300291355500468079109432376296868174257674548727592142782202898031102246775544402811199608266683925072825828225074019194302318324623049819212337927 0;
74 }
75
76 primeiter {
77   0 2 3 5 7 11;
78   2 2 3 5 7 11;
79   3 3 5 7 11 13;
80   4 5 7 11 13 17;
81
82   2309 2309 2311 2333 2339 2341;
83   7878 7879 7883 7901 7907 7919;
84   7879 7879 7883 7901 7907 7919;
85 }