Development of |
|
liste_max:=100000; sieving:=proc (stelle, p) begin while (stelle<=liste_max) do erg:=liste[stelle]; while(erg mod p=0) do // Divison of the stored f(x) by the prime erg:=erg /p; end_while; liste[stelle]:=erg; stelle:=stelle+p; end_while; end_proc; // Calculation of the values of the polynom for x from 0 to liste_max for x from 0 to liste_max do p:=abs (a*x^2+b*x+c); while (p mod 2=0) p:=p/2; liste [x]:=p; end_for; for x from 0 to liste_max do p:=liste[x]; if (p>1) then // Printing the Primes print (x, p); // 1. Sieving sieving (x+p, p); t:=(-x-b/a) mod p;If you are interested in some better algorithms have a look at quadr_Sieb_x^2+1.php.
if t=0 then t:=p; end_if; // 2. Sieving sieving (t, p); end_if; end_for;
2. Mathematical background
Lemma: If p | f(x) then also p | f(x+p) and p | f(-x-b/a) a) p | f(x) <=> ax^2 + bx + c = 0 mod p p | f(x+p) <=> a(x+p)^2 + b(x+p) + c = 0 mod p <=> ax^2 + 2axp + ap^2 + bx + bp + c = 0 mod p <=> ax^2 + bx + c = 0 mod p Thus if p | f(x) then p | f(x+p) b) if b = 0 mod a p | f(x) <=> ax^2 + bx + c = 0 mod p p | f(-x-b/a) <=> a(-x-b/a)^2 + b(-x-b/a) + c = 0 mod p <=> ax^2 + 2bx + b^2/a - bx - b^2/a + c = 0 mod p <=> ax^2 + bx + c = 0 mod p Thus if p | f(x) then p | f(-x-b/a)3. Correctness of the algorithm
The proof for this polynom is similar to the proof for the polynom f(x)=x^2-4x+1. a) First terms for the polynom f(x) = x^2-16x+2
f(0)=1
f(1)=13
f(2)=1
f(3)=37
f(4)=23
f(5)=53
f(6)=29
f(7)=61
f(8)=31
f(9)=1
f(10)=1
f(11)=1
f(12)=1
f(13)=1
f(14)=1
f(15)=1
f(16)=1
f(17)=19
f(18)=1
f(19)=59
f(20)=41
f(21)=107
f(22)=67
f(23)=163
f(24)=97
f(25)=227
f(26)=131
f(27)=1
f(28)=1
f(29)=379
f(30)=211
f(31)=467
f(32)=257
f(33)=563
f(34)=307
f(35)=1
f(36)=1
f(37)=1
f(38)=419
f(39)=1
f(40)=1
f(41)=79
f(42)=547
f(43)=1163
f(44)=617
f(45)=1307
f(46)=691
f(47)=1459
f(48)=769
f(49)=1619
f(50)=1
f(51)=1787
f(52)=937
f(53)=151
f(54)=1
f(55)=113
f(56)=1
f(57)=2339
f(58)=1
f(59)=2539
f(60)=1321
f(61)=1
f(62)=1427
f(63)=2963
f(64)=1
f(65)=3187
f(66)=127
f(67)=263
f(68)=1
f(69)=3659
f(70)=1
f(71)=3907
f(72)=2017
f(73)=181
f(74)=1
f(75)=233
f(76)=2281
f(77)=1
f(78)=1
f(79)=383
f(80)=197
f(81)=229
f(82)=2707
f(83)=5563
f(84)=2857
f(85)=5867
f(86)=3011
f(87)=167
f(88)=3169
f(89)=1
f(90)=3331
f(91)=6827
f(92)=269
f(93)=1
f(94)=193
f(95)=7507
f(96)=1
f(97)=271
f(98)=4019
f(99)=8219
b) Substitution of the polynom
The polynom f(x)=x^2-16x+2 could be written as f(y)= y^2-62 with x=y+8
c) Backsubstitution Beside by backsubstitution you get an estimation for the huge of the primes with p | f(x) and p < f(x) f'(y)>(2y-1) with with y=x-8
f'(x)>2x-17 with x > 8
A | B | C | D | E | F | G | H | I | J | K |
|
10^n | x | all Primes | P(x)=x^2-16x+2 | P(x) | x^2-16x+2 | C/B | D/B | E/B | C(n) / C(n-1) | D(n) / D(n-1) | E(n) / E(n-1) |
|
1 | 10 | 8 | 5 | 3 | 0,800000 | 0,500000 | 0,300000 |
| |||
2 | 100 | 70 | 29 | 41 | 0,700000 | 0,290000 | 0,410000 | 8,750000 | 5,800000 | 13,666667 |
|
3 | 1.000 | 719 | 168 | 551 | 0,719000 | 0,168000 | 0,551000 | 10,271429 | 5,793103 | 13,439024 |
|
4 | 10.000 | 7.200 | 1.202 | 5.998 | 0,720000 | 0,120200 | 0,599800 | 10,013908 | 7,154762 | 10,885662 |
|
5 | 100.000 | 71.724 | 9.337 | 62.387 | 0,717240 | 0,093370 | 0,623870 | 9,961667 | 7,767887 | 10,401300 |
|
6 | 1.000.000 | 712.508 | 76.320 | 636.188 | 0,712508 | 0,076320 | 0,636188 | 9,934025 | 8,173932 | 10,197445 |
|
7 | 10.000.000 | 7.093.022 | 645.063 | 6.447.959 | 0,709302 | 0,064506 | 0,644796 | 9,955007 | 8,452083 | 10,135304 |
|
8 | 100.000.000 | 70.710.106 | 5.596.204 | 65.113.902 | 0,707101 | 0,055962 | 0,651139 | 9,968968 | 8,675438 | 10,098374 |
|
9 | 1.000.000.000 | 705.431.613 | 49.375.937 | 656.055.676 | 0,705432 | 0,049376 | 0,656056 | 9,976390 | 8,823112 | 10,075509 |
|
10 | 10.000.000.000 | 7.040.983.987 | 441.890.595 | 6.599.093.392 | 0,704098 | 0,044189 | 0,659909 | 9,981101 | 8,949513 | 10,058740 |
|
11 | 100.000.000.000 | 70.302.773.396 | 3.998.928.092 | 66.303.845.304 | 0,703028 | 0,039989 | 0,663038 | 9,984794 | 9,049589 | 10,047417 |
|
12 | 1.000.000.000.000 | 702.147.035.673 | 36.519.999.574 | 665.627.036.099 | 0,702147 | 0,036520 | 0,665627 | 9,987473 | 9,132447 | 10,039041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A | B | C | D | E | F | G | H | I | J | K |
|
2^n | x | all Primes | P(x)=x^2-16x+2 | P(x) | x^2-16x+2 | C/B | D/B | E/B | C(n) / C(n-1) | D(n) / D(n-1) | E(n) / E(n-1) |
|
1 | 2 | 2 | 2 | 0 | 1,000000 | 1,000000 | 0,000000 |
| |||
2 | 4 | 4 | 3 | 1 | 1,000000 | 0,750000 | 0,250000 | 2,000000 | 1,500000 |
| |
3 | 8 | 8 | 5 | 3 | 1,000000 | 0,625000 | 0,375000 | 2,000000 | 1,666667 | 3,000000 |
|
4 | 16 | 8 | 5 | 3 | 0,500000 | 0,312500 | 0,187500 | 1,000000 | 1,000000 | 1,000000 |
|
5 | 32 | 21 | 12 | 9 | 0,656250 | 0,375000 | 0,281250 | 2,625000 | 2,400000 | 3,000000 |
|
6 | 64 | 42 | 21 | 21 | 0,656250 | 0,328125 | 0,328125 | 2,000000 | 1,750000 | 2,333333 |
|
7 | 128 | 88 | 34 | 54 | 0,687500 | 0,265625 | 0,421875 | 2,095238 | 1,619048 | 2,571429 |
|
8 | 256 | 183 | 58 | 125 | 0,714844 | 0,226563 | 0,488281 | 2,079545 | 1,705882 | 2,314815 |
|
9 | 512 | 364 | 97 | 267 | 0,710938 | 0,189453 | 0,521484 | 1,989071 | 1,672414 | 2,136000 |
|
10 | 1.024 | 736 | 171 | 565 | 0,718750 | 0,166992 | 0,551758 | 2,021978 | 1,762887 | 2,116105 |
|
11 | 2.048 | 1.469 | 313 | 1.156 | 0,717285 | 0,152832 | 0,564453 | 1,995924 | 1,830409 | 2,046018 |
|
12 | 4.096 | 2.951 | 562 | 2.389 | 0,720459 | 0,137207 | 0,583252 | 2,008850 | 1,795527 | 2,066609 |
|
13 | 8.192 | 5.909 | 1.003 | 4.906 | 0,721313 | 0,122437 | 0,598877 | 2,002372 | 1,784698 | 2,053579 |
|
14 | 16.384 | 11.782 | 1.850 | 9.932 | 0,719116 | 0,112915 | 0,606201 | 1,993908 | 1,844467 | 2,024460 |
|
15 | 32.768 | 23.546 | 3.426 | 20.120 | 0,718567 | 0,104553 | 0,614014 | 1,998472 | 1,851892 | 2,025775 |
|
16 | 65.536 | 47.059 | 6.355 | 40.704 | 0,718063 | 0,096970 | 0,621094 | 1,998598 | 1,854933 | 2,023062 |
|
17 | 131.072 | 93.937 | 11.909 | 82.028 | 0,716682 | 0,090858 | 0,625824 | 1,996154 | 1,873958 | 2,015232 |
|
18 | 262.144 | 187.390 | 22.221 | 165.169 | 0,714836 | 0,084766 | 0,630070 | 1,994848 | 1,865900 | 2,013569 |
|
19 | 524.288 | 374.082 | 42.075 | 332.007 | 0,713505 | 0,080252 | 0,633253 | 1,996275 | 1,893479 | 2,010105 |
|
20 | 1.048.576 | 746.958 | 79.781 | 667.177 | 0,712355 | 0,076085 | 0,636270 | 1,996776 | 1,896162 | 2,009527 |
|
21 | 2.097.152 | 1.491.510 | 151.120 | 1.340.390 | 0,711207 | 0,072060 | 0,639148 | 1,996779 | 1,894185 | 2,009047 |
|
22 | 4.194.304 | 2.979.058 | 287.216 | 2.691.842 | 0,710263 | 0,068478 | 0,641785 | 1,997344 | 1,900582 | 2,008253 |
|
23 | 8.388.608 | 5.951.774 | 547.406 | 5.404.368 | 0,709507 | 0,065256 | 0,644251 | 1,997871 | 1,905904 | 2,007684 |
|
24 | 16.777.216 | 11.890.419 | 1.046.472 | 10.843.947 | 0,708724 | 0,062375 | 0,646350 | 1,997794 | 1,911693 | 2,006515 |
|
25 | 33.554.432 | 23.758.408 | 2.004.260 | 21.754.148 | 0,708056 | 0,059732 | 0,648324 | 1,998114 | 1,915254 | 2,006110 |
|
26 | 67.108.864 | 47.475.497 | 3.844.550 | 43.630.947 | 0,707440 | 0,057288 | 0,650152 | 1,998261 | 1,918189 | 2,005638 |
|
27 | 134.217.728 | 94.875.809 | 7.384.191 | 87.491.618 | 0,706880 | 0,055017 | 0,651863 | 1,998416 | 1,920691 | 2,005265 |
|
28 | 268.435.456 | 189.607.422 | 14.208.341 | 175.399.081 | 0,706343 | 0,052930 | 0,653412 | 1,998480 | 1,924157 | 2,004753 |
|
29 | 536.870.912 | 378.949.878 | 27.378.369 | 351.571.509 | 0,705849 | 0,050996 | 0,654853 | 1,998603 | 1,926922 | 2,004409 |
|
30 | 1.073.741.824 | 757.402.963 | 52.825.776 | 704.577.187 | 0,705386 | 0,049198 | 0,656189 | 1,998689 | 1,929471 | 2,004079 |
|
31 | 2.147.483.648 | 1.513.881.145 | 102.057.253 | 1.411.823.892 | 0,704956 | 0,047524 | 0,657432 | 1,998779 | 1,931959 | 2,003789 |
|
32 | 4.294.967.296 | 3.026.021.209 | 197.399.844 | 2.828.621.365 | 0,704550 | 0,045961 | 0,658590 | 1,998850 | 1,934207 | 2,003523 |
|
33 | 8.589.934.592 | 6.048.852.483 | 382.231.908 | 5.666.620.575 | 0,704179 | 0,044498 | 0,659681 | 1,998946 | 1,936333 | 2,003315 |
|
34 | 17.179.869.184 | 12.091.659.008 | 740.857.699 | 11.350.801.309 | 0,703827 | 0,043124 | 0,660704 | 1,999000 | 1,938241 | 2,003099 |
|
35 | 34.359.738.368 | 24.171.998.907 | 1.437.402.424 | 22.734.596.483 | 0,703498 | 0,041834 | 0,661664 | 1,999064 | 1,940187 | 2,002907 |
|
36 | 68.719.476.736 | 48.322.679.667 | 2.791.252.099 | 45.531.427.568 | 0,703188 | 0,040618 | 0,662569 | 1,999118 | 1,941872 | 2,002737 |
|
37 | 137.438.953.472 | 96.605.348.500 | 5.424.891.506 | 91.180.456.994 | 0,702896 | 0,039471 | 0,663425 | 1,999172 | 1,943533 | 2,002583 |
|
38 | 274.877.906.944 | 193.134.895.286 | 10.551.959.945 | 182.582.935.341 | 0,702621 | 0,038388 | 0,664233 | 1,999215 | 1,945101 | 2,002435 |
|
39 | 549.755.813.888 | 386.126.797.856 | 20.539.917.412 | 365.586.880.444 | 0,702361 | 0,037362 | 0,664999 | 1,999260 | 1,946550 | 2,002306 |
|
40 | 1.099.511.627.776 | 771.982.707.683 | 40.011.095.600 | 731.971.612.083 | 0,702114 | 0,036390 | 0,665724 | 1,999298 | 1,947968 | 2,002182 |
|
| |||||||||||
| |||||||||||