1How to Debug using gdb,
2
3cat unitTest.log
4
5Primpoly Version 16.4 - A Program for Computing Primitive Polynomials.
6Copyright (C) 1999-2025 by Sean Erik O'Connor. All Rights Reserved.
7
8Primpoly comes with ABSOLUTELY NO WARRANTY; for details see the
9GNU General Public License. This is free software, and you are welcome
10to redistribute it under certain conditions; see the GNU General Public License
11for details.
12
13Begin unit testing...
14TEST: Parsing the command line options..........PASS!
15TEST: parsing constant 0.........PASS!
16TEST: parsing polynomial and modulus: 2 x ^ 3 + 3 x + 4, 5.........PASS!
17TEST: parsing polynomial, modulus: 2x, 7..........PASS!
18TEST: parsing constant 2.........PASS!
19TEST: parsing bad syntax: x + 1.........PASS!
20TEST: Switching from base 2147483648 to new base 10.........PASS!
21TEST: BigInt() default constructor..........PASS!
22TEST: BigInt( 0 ) constructor from zero..........PASS!
23TEST: BigInt( 1234 ) constructor from uint.........PASS!
24TEST: BigInt u( "1234" ) constructor from <decimal number string>.........PASS!
25TEST: BigInt u( "12x34" ) constructor from invalid <decimal number string>.........PASS!
26TEST: BigInt copy constructor: u( 123 ) ; v( u )..........PASS!
27TEST: BigInt u = v assignment for BigInt.........PASS!
28TEST: cast BigInt to uint implicitly Bigint u ; uint d = u..........PASS!
29TEST: cast BigInt to uint explicitly: BigInt u ; static_cast<uint>(u)..........PASS!
30TEST: overflow during cast from BigInt to uint?.........PASS!
31TEST: stream output << BigInt.........PASS!
32TEST: stream input >> BigInt.........PASS!
33TEST: BigInt == uint.........PASS!
34TEST: BigInt == BigInt.........PASS!
35TEST: BigInt > uint.........PASS!
36TEST: BigInt -= uint.........PASS!
37TEST: BigInt -= uint underflow.........PASS!
38TEST: BigInt += uint.........PASS!
39TEST: BigInt *= uint.........PASS!
40TEST: BigInt /= uint.........PASS!
41TEST: BigInt /= uint underflow to zero..........PASS!
42TEST: ++BigInt.........PASS!
43TEST: --BigInt.........PASS!
44TEST: BigInt++.........PASS!
45TEST: BigInt--.........PASS!
46TEST: one digit BigInt + uint.........PASS!
47TEST: two digit BigInt + uint.........PASS!
48TEST: BigInt + BigInt.........PASS!
49TEST: BigInt + BigInt.........PASS!
50TEST: BigInt - BigInt.........PASS!
51TEST: BigInt - BigInt < 0.........PASS!
52TEST: BigInt - uint.........PASS!
53TEST: one digit BigInt * BigInt.........PASS!
54TEST: two digit BigInt * BigInt.........PASS!
55TEST: BigInt multidigit *.........PASS!
56TEST: BigInt multidigit *=.........PASS!
57TEST: BigInt / BigInt one digit divisor..........PASS!
58TEST: BigInt / BigInt multidigit.........PASS!
59TEST: BigInt / BigInt leading zero digit..........PASS!
60TEST: BigInt / 0 .........PASS!
61TEST: BigInt % BigInt with u > v.........PASS!
62TEST: BigInt multidigit mod with normalizing constant d = 1.........PASS!
63TEST: BigInt % BigInt with u < v.........PASS!
64TEST: BigInt % uint = 314159 / 9 = 5 with uint < base .........PASS!
65TEST: BigInt % uint = 398765 % 3457u with uint > base overflow?.........PASS!
66TEST: BigInt / BigInt low probability if branch..........PASS!
67TEST: Switching back from base 10 to oldBase 2147483648.........PASS!
68TEST: Decimal string to BigInt conversion and back to decimal string using default base..........PASS!
69TEST: BigInt z = x * y then x =? z / y multidigit with default base..........PASS!
70TEST: BigInt testBit.........PASS!
71TEST: testBit().........PASS!
72TEST: BigInt power( uint 2, uint 100 ).........PASS!
73TEST: BigInt ceilLg( 6 ).........PASS!
74TEST: ModP 10 = 3 (mod 7).........PASS!
75TEST: ModP -10 = 4 (mod 7).........PASS!
76TEST: uint gcd( 85, 25 ) = 5.........PASS!
77TEST: BigInt gcd( 779953197883173551166308319545, 1282866356929526866866376009397 ) = 1.........PASS!
78TEST: PowerMod uint 3^10 = 4 (mod 7).........PASS!
79TEST: PowerMod BigInt 3^10 = 4 (mod 7).........PASS!
80TEST: PowerMod with out of range inputs..........PASS!
81TEST: InverseModP 3 * 5 = 1 (mod 7).........PASS!
82TEST: IsPrimitiveRoot. 3 is a primitive root of 7..........PASS!
83TEST: IsPrimitiveRoot. 2 is a primitive root of 11..........PASS!
84TEST: IsPrimitiveRoot. 3 is NOT a primitive root of 11..........PASS!
85TEST: IsPrimitiveRoot. 5 is a primitive root of 65003..........PASS!
86TEST: IsPrimitiveRoot. 8 is NOT a primitive root of 65003..........PASS!
87TEST: constant coefficient test..........PASS!
88TEST: constant coefficient is primitive root..........PASS!
89TEST: isProbablyPrime uint 97 with random x = 10 says yes..........PASS!
90TEST: isAlmostSurelyPrime 97 says yes..........PASS!
91TEST: isAlmostSurelyPrime BigInt 97 says yes.........PASS!
92TEST: isAlmostSurelyPrime 49 says no..........PASS!
93TEST: isAlmostSurelyPrime on the 10000th prime number 104729 which is >> 32768 = 2^(32/2-1) says yes..........PASS!
94TEST: Trial division factoring on unsigned int..........PASS!
95TEST: Trial division factor BigInt 337500 = 2^2 3^3 5^5..........PASS!
96TEST: Pollard Rho factor unsigned int 25852 = 2^2 23 281.........PASS!
97TEST: Pollard Rho factor BigInt 25852 = 2^2 23 281.........PASS!
98TEST: Factor Copy constructor.........PASS!
99TEST: Factor assignment operator.........PASS!
100TEST: Factor BigInt 24018350267611933650627567399079537500 = 2^2 3^3 5^5 7^7 11^11 13^13..........PASS!
101TEST: BigInt computation of p^n, r, factors of r, EulerPhi[ p^n - 1]/n for p = 2.........PASS!
102TEST: BigInt computation of p^n, r, factors of r, EulerPhi[ p^n - 1]/n for p > 2
103 ERROR: BigInt computation of p^n, r, factors of r, EulerPhi[ p^n - 1]/n for p > 2
104 ERROR: BigIntMathError: BigInt::operator-= negative result for u - v = 0 - 1 at ../SourceCode/Primpoly/ppBigInt.cpp: line 1057
105
106TEST: Factor tables for Factor<uint>.........PASS!
107TEST: Factor tables for Factor<BigInt>.........PASS!
108TEST: Polynomial() default constructor..........PASS!
109TEST: Polynomial() from string..........PASS!
110TEST: Polynomial = string..........PASS!
111TEST: Polynomial() from string with negative constant..........PASS!
112TEST: Polynomial() to string..........PASS!
113TEST: Polynomial() copy constructor..........PASS!
114TEST: Polynomial assignment operator..........PASS!
115TEST: Polynomial()[] read only operator..........PASS!
116TEST: Polynomial()[] accessing coeff higher than its degree..........PASS!
117TEST: Polynomial()[] lvalue operator..........PASS!
118TEST: Polynomial() += operator..........PASS!
119TEST: Polynomial() += operator..........PASS!
120TEST: Polynomial() + operator..........PASS!
121TEST: Polynomial * scalar.........PASS!
122TEST: Polynomial evaluation x^4 + 3x + 3 (mod 5).........PASS!
123TEST: Polynomial evaluation x^4 + x + 1 (mod 2).........PASS!
124TEST: Polynomial hasLinearFactor is true.........PASS!
125TEST: Polynomial hasLinearFactor is false.........PASS!
126TEST: Polynomial isInteger.........PASS!.........PASS!
127TEST: Polynomial initial and next trial polynomials.........PASS!
128TEST: PolyMod constructor from polynomials..........PASS!
129TEST: PolyMod constructor from string and polynomial..........PASS!
130TEST: PolyMod timesX..........PASS!
131TEST: PolyMod autoconvolve..........PASS!
132TEST: PolyMod convolve..........PASS!
133TEST: PolyMod coeffOfSquare..........PASS!
134TEST: PolyMod coeffOfProduct..........PASS!
135TEST: PolyMod square..........PASS!
136TEST: PolyMod operator* and implicitly, operator*=.........PASS!
137TEST: PolyMod x_to_power and isInteger().........PASS!
138TEST: PolyOrder reduced Q-I matrix
139 ERROR: PolynomialRangeError error: PolyOrder: problem computing p^n or r = (p^n - 1 )/ (p - 1), or factoring r, or finding EulerPhi( p^n - 1 )/ n p = 5 n = 4 at ../SourceCode/Primpoly/ppPolynomial.cpp: line 2638BigInt::operator-= negative result for u - v = 0 - 1 at ../SourceCode/Primpoly/ppBigInt.cpp: line 1057
140
141TEST: PolyOrder 3 distinct factors out of 4
142 ERROR: PolynomialRangeError error: PolyOrder: problem computing p^n or r = (p^n - 1 )/ (p - 1), or factoring r, or finding EulerPhi( p^n - 1 )/ n p = 5 n = 4 at ../SourceCode/Primpoly/ppPolynomial.cpp: line 2638BigInt::operator-= negative result for u - v = 0 - 1 at ../SourceCode/Primpoly/ppBigInt.cpp: line 1057
143
144TEST: PolyOrder 2 distinct factors.........PASS!
145TEST: PolyOrder irreducible
146 ERROR: PolynomialRangeError error: PolyOrder: problem computing p^n or r = (p^n - 1 )/ (p - 1), or factoring r, or finding EulerPhi( p^n - 1 )/ n p = 5 n = 4 at ../SourceCode/Primpoly/ppPolynomial.cpp: line 2638BigInt::operator-= negative result for u - v = 0 - 1 at ../SourceCode/Primpoly/ppBigInt.cpp: line 1057
147
148TEST: PolyOrder 1 distinct factor 4 times
149 ERROR: PolynomialRangeError: PolyOrder: problem computing p^n or r = (p^n - 1 )/ (p - 1), or factoring r, or finding EulerPhi( p^n - 1 )/ n p = 5 n = 4 at ../SourceCode/Primpoly/ppPolynomial.cpp: line 2638BigInt::operator-= negative result for u - v = 0 - 1 at ../SourceCode/Primpoly/ppBigInt.cpp: line 1057
150
151End unit testing...
152SORRY. One or more unit tests failed!
153
154
155
156
157$ gdb Bin/Primpoly.exe
158
159GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Wed Sep 22 02:45:02 UTC 2010)
160Copyright 2004 Free Software Foundation, Inc.
161GDB is free software, covered by the GNU General Public License, and you are
162welcome to change it and/or distribute copies of it under certain conditions.
163Type "show copying" to see the conditions.
164There is absolutely no warranty for GDB. Type "show warranty" for details.
165This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done
166
167(gdb) b ppBigInt.cpp:1057
168Breakpoint 1 at 0x10000d5f7: file ../SourceCode/Primpoly/ppBigInt.cpp, line 1057.
169
170(gdb) run 2 4
171Starting program: /Volumes/Sean/Sean/WebSite/Mathematics/AbstractAlgebra/PrimitivePolynomials/Project/Build/Bin/Primpoly.exe 2 4
172Reading symbols for shared libraries ++. done
173
174Primpoly Version 16.4 - A Program for Computing Primitive Polynomials.
175Copyright (C) 1999-2025 by Sean Erik O'Connor. All Rights Reserved.
176
177Primpoly comes with ABSOLUTELY NO WARRANTY; for details see the
178GNU General Public License. This is free software, and you are welcome
179to redistribute it under certain conditions; see the GNU General Public License
180for details.
181
182Pollard rho n = 25852 c = 2
183 inner while loop, gcd = g = 1 |x -xp| = 3 n_ = 25852 k = 1 l = 1
184 after division, n_ = 25852 x = 27 xp = 5
185 inner while loop, gcd = g = 2 |x -xp| = 22 n_ = 25852 k = 2 l = 2
186 >>>>>prime factor g = 2
187 after division, n_ = 12926 x = 27 xp = 5
188 inner while loop, gcd = g = 2 |x -xp| = 22 n_ = 12926 k = 2 l = 2
189 >>>>>prime factor g = 2
190 after division, n_ = 6463 x = 27 xp = 5
191 inner while loop, gcd = g = 1 |x -xp| = 22 n_ = 6463 k = 2 l = 2
192 after division, n_ = 6463 x = 731 xp = 5
193 inner while loop, gcd = g = 1 |x -xp| = 726 n_ = 6463 k = 1 l = 2
194 after division, n_ = 6463 x = 4397 xp = 731
195 inner while loop, gcd = g = 1 |x -xp| = 3666 n_ = 6463 k = 4 l = 4
196 after division, n_ = 6463 x = 2778 xp = 731
197 inner while loop, gcd = g = 23 |x -xp| = 2047 n_ = 6463 k = 3 l = 4
198 >>>>>prime factor g = 23
199 after division, n_ = 281 x = 249 xp = 169
200 >>>>>prime factor n_ = 281
201Pollard rho n = 25852 c = 2
202 inner while loop, gcd = g = 1 |x -xp| = 3 n_ = 25852 k = 1 l = 1
203 after division, n_ = 25852 x = 27 xp = 5
204 inner while loop, gcd = g = 2 |x -xp| = 22 n_ = 25852 k = 2 l = 2
205 >>>>>prime factor g = 2
206 after division, n_ = 12926 x = 27 xp = 5
207 inner while loop, gcd = g = 2 |x -xp| = 22 n_ = 12926 k = 2 l = 2
208 >>>>>prime factor g = 2
209 after division, n_ = 6463 x = 27 xp = 5
210 inner while loop, gcd = g = 1 |x -xp| = 22 n_ = 6463 k = 2 l = 2
211 after division, n_ = 6463 x = 731 xp = 5
212 inner while loop, gcd = g = 1 |x -xp| = 726 n_ = 6463 k = 1 l = 2
213 after division, n_ = 6463 x = 4397 xp = 731
214 inner while loop, gcd = g = 1 |x -xp| = 3666 n_ = 6463 k = 4 l = 4
215 after division, n_ = 6463 x = 2778 xp = 731
216 inner while loop, gcd = g = 23 |x -xp| = 2047 n_ = 6463 k = 3 l = 4
217 >>>>>prime factor g = 23
218 after division, n_ = 281 x = 249 xp = 169
219 >>>>>prime factor n_ = 281
220Pollard rho n = 24018350267611933650627567399079537500 c = 2
221 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 24018350267611933650627567399079537500 k = 1 l = 1
222 >>>>>prime factor g = 3
223 after division, n_ = 8006116755870644550209189133026512500 x = 5 xp = 2
224 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 8006116755870644550209189133026512500 k = 1 l = 1
225 >>>>>prime factor g = 3
226 after division, n_ = 2668705585290214850069729711008837500 x = 5 xp = 2
227 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 2668705585290214850069729711008837500 k = 1 l = 1
228 >>>>>prime factor g = 3
229 after division, n_ = 889568528430071616689909903669612500 x = 5 xp = 2
230 inner while loop, gcd = g = 1 |x -xp| = 3 n_ = 889568528430071616689909903669612500 k = 1 l = 1
231 after division, n_ = 889568528430071616689909903669612500 x = 27 xp = 5
232 inner while loop, gcd = g = 22 |x -xp| = 22 n_ = 889568528430071616689909903669612500 k = 2 l = 2
233 g = 22 isn't prime
234Pollard rho n = 889568528430071616689909903669612500 c = 5
235 inner while loop, gcd = g = 1 |x -xp| = 3 n_ = 889568528430071616689909903669612500 k = 1 l = 1
236 after division, n_ = 889568528430071616689909903669612500 x = 30 xp = 5
237 inner while loop, gcd = g = 25 |x -xp| = 25 n_ = 889568528430071616689909903669612500 k = 2 l = 2
238 g = 25 isn't prime
239Pollard rho n = 68719476735 c = 2
240 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 68719476735 k = 1 l = 1
241 >>>>>prime factor g = 3
242 after division, n_ = 22906492245 x = 5 xp = 2
243 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 22906492245 k = 1 l = 1
244 >>>>>prime factor g = 3
245 after division, n_ = 7635497415 x = 5 xp = 2
246 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 7635497415 k = 1 l = 1
247 >>>>>prime factor g = 3
248 after division, n_ = 2545165805 x = 5 xp = 2
249 inner while loop, gcd = g = 1 |x -xp| = 3 n_ = 2545165805 k = 1 l = 1
250 after division, n_ = 2545165805 x = 27 xp = 5
251 inner while loop, gcd = g = 1 |x -xp| = 22 n_ = 2545165805 k = 2 l = 2
252 after division, n_ = 2545165805 x = 731 xp = 5
253 inner while loop, gcd = g = 1 |x -xp| = 726 n_ = 2545165805 k = 1 l = 2
254 after division, n_ = 2545165805 x = 534363 xp = 731
255 inner while loop, gcd = g = 1 |x -xp| = 533632 n_ = 2545165805 k = 4 l = 4
256 after division, n_ = 2545165805 x = 485245611 xp = 731
257 inner while loop, gcd = g = 5 |x -xp| = 485244880 n_ = 2545165805 k = 3 l = 4
258 >>>>>prime factor g = 5
259 after division, n_ = 509033161 x = 485245611 xp = 731
260 inner while loop, gcd = g = 1 |x -xp| = 485244880 n_ = 509033161 k = 3 l = 4
261 after division, n_ = 509033161 x = 164836970 xp = 731
262 inner while loop, gcd = g = 1 |x -xp| = 164836239 n_ = 509033161 k = 2 l = 4
263 after division, n_ = 509033161 x = 144374675 xp = 731
264 inner while loop, gcd = g = 13 |x -xp| = 144373944 n_ = 509033161 k = 1 l = 4
265 >>>>>prime factor g = 13
266 after division, n_ = 39156397 x = 26905484 xp = 731
267 inner while loop, gcd = g = 1 |x -xp| = 26904753 n_ = 39156397 k = 1 l = 4
268 after division, n_ = 39156397 x = 5044848 xp = 26905484
269 inner while loop, gcd = g = 259 |x -xp| = 21860636 n_ = 39156397 k = 8 l = 8
270 g = 259 isn't prime
271Pollard rho n = 39156397 c = 5
272 inner while loop, gcd = g = 1 |x -xp| = 3 n_ = 39156397 k = 1 l = 1
273 after division, n_ = 39156397 x = 30 xp = 5
274 inner while loop, gcd = g = 1 |x -xp| = 25 n_ = 39156397 k = 2 l = 2
275 after division, n_ = 39156397 x = 905 xp = 5
276 inner while loop, gcd = g = 1 |x -xp| = 900 n_ = 39156397 k = 1 l = 2
277 after division, n_ = 39156397 x = 819030 xp = 905
278 inner while loop, gcd = g = 7 |x -xp| = 818125 n_ = 39156397 k = 4 l = 4
279 >>>>>prime factor g = 7
280 after division, n_ = 5593771 x = 819030 xp = 905
281 inner while loop, gcd = g = 1 |x -xp| = 818125 n_ = 5593771 k = 4 l = 4
282 after division, n_ = 5593771 x = 5122585 xp = 905
283 inner while loop, gcd = g = 73 |x -xp| = 5121680 n_ = 5593771 k = 3 l = 4
284 >>>>>prime factor g = 73
285 after division, n_ = 76627 x = 65203 xp = 905
286 inner while loop, gcd = g = 1 |x -xp| = 64298 n_ = 76627 k = 3 l = 4
287 after division, n_ = 76627 x = 12000 xp = 905
288 inner while loop, gcd = g = 1 |x -xp| = 11095 n_ = 76627 k = 2 l = 4
289 after division, n_ = 76627 x = 17872 xp = 905
290 inner while loop, gcd = g = 19 |x -xp| = 16967 n_ = 76627 k = 1 l = 4
291 >>>>>prime factor g = 19
292 after division, n_ = 4033 x = 1740 xp = 905
293 inner while loop, gcd = g = 1 |x -xp| = 835 n_ = 4033 k = 1 l = 4
294 after division, n_ = 4033 x = 2855 xp = 1740
295 inner while loop, gcd = g = 1 |x -xp| = 1115 n_ = 4033 k = 8 l = 8
296 after division, n_ = 4033 x = 337 xp = 1740
297 inner while loop, gcd = g = 1 |x -xp| = 1403 n_ = 4033 k = 7 l = 8
298 after division, n_ = 4033 x = 650 xp = 1740
299 inner while loop, gcd = g = 109 |x -xp| = 1090 n_ = 4033 k = 6 l = 8
300 >>>>>prime factor g = 109
301 after division, n_ = 37 x = 21 xp = 1
302 >>>>>prime factor n_ = 37
303p = 2
304n = 36
305p^n = 68719476736
306r = (p^n-1)/(p-1) = 68719476735
3078 sorted unique factors of r
3083 ^ 3
3095 ^ 1
3107 ^ 1
31113 ^ 1
31219 ^ 1
31337 ^ 1
31473 ^ 1
315109 ^ 1
3168 distinct primes for p^n - 1
3173
3185
3197
32013
32119
32237
32373
324109
325numPrimitivePoly = 725594112
326Pollard rho n = 435984840 c = 2
327 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 435984840 k = 1 l = 1
328 >>>>>prime factor g = 3
329 after division, n_ = 145328280 x = 5 xp = 2
330 inner while loop, gcd = g = 3 |x -xp| = 3 n_ = 145328280 k = 1 l = 1
331 >>>>>prime factor g = 3
332 after division, n_ = 48442760 x = 5 xp = 2
333 inner while loop, gcd = g = 1 |x -xp| = 3 n_ = 48442760 k = 1 l = 1
334 after division, n_ = 48442760 x = 27 xp = 5
335 inner while loop, gcd = g = 2 |x -xp| = 22 n_ = 48442760 k = 2 l = 2
336 >>>>>prime factor g = 2
337 after division, n_ = 24221380 x = 27 xp = 5
338 inner while loop, gcd = g = 2 |x -xp| = 22 n_ = 24221380 k = 2 l = 2
339 >>>>>prime factor g = 2
340 after division, n_ = 12110690 x = 27 xp = 5
341 inner while loop, gcd = g = 2 |x -xp| = 22 n_ = 12110690 k = 2 l = 2
342 >>>>>prime factor g = 2
343 after division, n_ = 6055345 x = 27 xp = 5
344 inner while loop, gcd = g = 1 |x -xp| = 22 n_ = 6055345 k = 2 l = 2
345 after division, n_ = 6055345 x = 731 xp = 5
346 inner while loop, gcd = g = 1 |x -xp| = 726 n_ = 6055345 k = 1 l = 2
347 after division, n_ = 6055345 x = 534363 xp = 731
348 inner while loop, gcd = g = 1 |x -xp| = 533632 n_ = 6055345 k = 4 l = 4
349 after division, n_ = 6055345 x = 4022296 xp = 731
350 inner while loop, gcd = g = 5 |x -xp| = 4021565 n_ = 6055345 k = 3 l = 4
351 >>>>>prime factor g = 5
352 after division, n_ = 1211069 x = 389089 xp = 731
353 inner while loop, gcd = g = 1 |x -xp| = 388358 n_ = 1211069 k = 3 l = 4
354 after division, n_ = 1211069 x = 569578 xp = 731
355 inner while loop, gcd = g = 1 |x -xp| = 568847 n_ = 1211069 k = 2 l = 4
356 after division, n_ = 1211069 x = 356504 xp = 731
357 inner while loop, gcd = g = 1 |x -xp| = 355773 n_ = 1211069 k = 1 l = 4
358 after division, n_ = 1211069 x = 676882 xp = 356504
359 inner while loop, gcd = g = 1 |x -xp| = 320378 n_ = 1211069 k = 8 l = 8
360 after division, n_ = 1211069 x = 39984 xp = 356504
361 inner while loop, gcd = g = 1 |x -xp| = 316520 n_ = 1211069 k = 7 l = 8
362 after division, n_ = 1211069 x = 109178 xp = 356504
363 inner while loop, gcd = g = 1 |x -xp| = 247326 n_ = 1211069 k = 6 l = 8
364 after division, n_ = 1211069 x = 494588 xp = 356504
365 inner while loop, gcd = g = 1 |x -xp| = 138084 n_ = 1211069 k = 5 l = 8
366 after division, n_ = 1211069 x = 728850 xp = 356504
367 inner while loop, gcd = g = 1 |x -xp| = 372346 n_ = 1211069 k = 4 l = 8
368 after division, n_ = 1211069 x = 227411 xp = 356504
369 inner while loop, gcd = g = 1 |x -xp| = 129093 n_ = 1211069 k = 3 l = 8
370 after division, n_ = 1211069 x = 694485 xp = 356504
371 inner while loop, gcd = g = 1 |x -xp| = 337981 n_ = 1211069 k = 2 l = 8
372 after division, n_ = 1211069 x = 1185977 xp = 356504
373 inner while loop, gcd = g = 1 |x -xp| = 829473 n_ = 1211069 k = 1 l = 8
374 after division, n_ = 1211069 x = 1063655 xp = 1185977
375 inner while loop, gcd = g = 29 |x -xp| = 122322 n_ = 1211069 k = 16 l = 16
376 >>>>>prime factor g = 29
377 after division, n_ = 41761 x = 19630 xp = 16669
378 >>>>>prime factor n_ = 41761
379p = 17
380n = 8
381p^n = 6975757441
382r = (p^n-1)/(p-1) = 435984840
3835 sorted unique factors of r
3842 ^ 3
3853 ^ 2
3865 ^ 1
38729 ^ 1
38841761 ^ 1
3891 sorted unique factors of p-1
3902 ^ 4
391
392
393
394
395Breakpoint 1, BigInt::operator-= (this=0x7fff5fbf9170, v=@0x7fff5fbf95b0) at ../SourceCode/Primpoly/ppBigInt.cpp:1057
3961057 << " at " << __FILE__ << ": line " << __LINE__ ;
397
398(gdb) up
399#1 0x000000010000d8f3 in operator- (u=@0x1002036d8, v=@0x7fff5fbf95b0) at ../SourceCode/Primpoly/ppBigInt.cpp:976
400976 return BigInt( u ) -= v ;
401
402(gdb) up
403#2 0x0000000100047527 in factorRAndFindNumberOfPrimitivePolynomials (p=17, n=8, maxNumPossiblePoly=@0x7fff5fbfbcf0, r=@0x7fff5fbfb9f0, factorsOfR=@0x7fff5fbfaea0, numPrimitivePoly=@0x7fff5fbfbde0) at ../SourceCode/Primpoly/ppFactor.cpp:2513
4042513 numPrimitivePoly *= (allDistinctPrimes[ i ] - static_cast<BigInt>( 1u )) ;
405
406(gdb) l
4072508 // i
4082509 // Multiply by -------
4092510 // p
4102511 // i
4112512 for (unsigned int i = 0u ; i < allDistinctPrimes.size() ; ++i)
4122513 numPrimitivePoly *= (allDistinctPrimes[ i ] - static_cast<BigInt>( 1u )) ;
4132514
4142515 for (unsigned int i = 0u ; i < allDistinctPrimes.size() ; ++i)
4152516 numPrimitivePoly /= allDistinctPrimes[ i ] ;
4162517
417
418(gdb) p p
419$1 = 17
420
421(gdb) p n
422$2 = 8
423
424(gdb) call printNumber(std::cout,r)
425 BigInt number 435984840 (base b = 2147483648, number of digits = 1)
426
427(gdb) call printNumber(std::cout,maxNumPossiblePoly)
428 BigInt number 3 533306497 (base b = 2147483648, number of digits = 2)
429
430(gdb) p factorsOfR.num()
431$3 = 5
432
433(gdb) call printNumber(std::cout,allDistinctPrimes[i])
434 BigInt number 0 (base b = 2147483648, number of digits = 1)
435
436(gdb) p i
437$1 = 5
438
439(gdb) p allDistinctPrimes.size()
440$2 = 6
441
442(gdb) call printNumber(std::cout,allDistinctPrimes[0])
443 BigInt number 2 (base b = 2147483648, number of digits = 1)
444(gdb) call printNumber(std::cout,allDistinctPrimes[1])
445 BigInt number 3 (base b = 2147483648, number of digits = 1)
446(gdb) call printNumber(std::cout,allDistinctPrimes[2])
447 BigInt number 5 (base b = 2147483648, number of digits = 1)
448(gdb) call printNumber(std::cout,allDistinctPrimes[3])
449 BigInt number 29 (base b = 2147483648, number of digits = 1)
450(gdb) call printNumber(std::cout,allDistinctPrimes[4])
451 BigInt number 41761 (base b = 2147483648, number of digits = 1)
452(gdb) call printNumber(std::cout,allDistinctPrimes[5])
453 BigInt number 0 (base b = 2147483648, number of digits = 1)
454(gdb) q
455The program is running. Exit anyway? (y or n) y