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+2x-1
f(0)=1
f(1)=1
f(2)=7
f(3)=1
f(4)=23
f(5)=17
f(6)=47
f(7)=31
f(8)=79
f(9)=1
f(10)=1
f(11)=71
f(12)=167
f(13)=97
f(14)=223
f(15)=127
f(16)=41
f(17)=1
f(18)=359
f(19)=199
f(20)=439
f(21)=241
f(22)=1
f(23)=1
f(24)=89
f(25)=337
f(26)=727
f(27)=1
f(28)=839
f(29)=449
f(30)=137
f(31)=73
f(32)=1087
f(33)=577
f(34)=1223
f(35)=647
f(36)=1367
f(37)=103
f(38)=1
f(39)=1
f(40)=1
f(41)=881
f(42)=1847
f(43)=967
f(44)=1
f(45)=151
f(46)=2207
f(47)=1151
f(48)=2399
f(49)=1249
f(50)=113
f(51)=193
f(52)=401
f(53)=1
f(54)=3023
f(55)=1567
f(56)=191
f(57)=1
f(58)=1
f(59)=257
f(60)=3719
f(61)=1
f(62)=3967
f(63)=1
f(64)=1
f(65)=311
f(66)=641
f(67)=2311
f(68)=4759
f(69)=1
f(70)=5039
f(71)=2591
f(72)=761
f(73)=1
f(74)=5623
f(75)=2887
f(76)=5927
f(77)=3041
f(78)=367
f(79)=457
f(80)=937
f(81)=3361
f(82)=1
f(83)=3527
f(84)=233
f(85)=3697
f(86)=1
f(87)=1
f(88)=7919
f(89)=4049
f(90)=487
f(91)=4231
f(92)=8647
f(93)=631
f(94)=1289
f(95)=271
f(96)=409
f(97)=4801
f(98)=239
f(99)=4999
b) Substitution of the polynom
The polynom f(x)=x^2+2x-1 could be written as f(y)= y^2-2 with x=y-1
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+1
f'(x)>2x+1
A | B | C | D | E | F | G | H | I | J | K |
|
10^n | x | all Primes | P(x)=x^2+2x-1 | P(x) | x^2+2x-1 | C/B | D/B | E/B | C(n) / C(n-1) | D(n) / D(n-1) | E(n) / E(n-1) |
|
1 | 10 | 7 | 5 | 2 | 0,700000 | 0,500000 | 0,200000 |
| |||
2 | 100 | 77 | 26 | 51 | 0,770000 | 0,260000 | 0,510000 | 11,000000 | 5,200000 | 25,500000 |
|
3 | 1.000 | 750 | 157 | 593 | 0,750000 | 0,157000 | 0,593000 | 9,740260 | 6,038462 | 11,627451 |
|
4 | 10.000 | 7.379 | 1.153 | 6.226 | 0,737900 | 0,115300 | 0,622600 | 9,838667 | 7,343949 | 10,499157 |
|
5 | 100.000 | 72.842 | 8.888 | 63.954 | 0,728420 | 0,088880 | 0,639540 | 9,871527 | 7,708586 | 10,272085 |
|
6 | 1.000.000 | 721.999 | 72.928 | 649.071 | 0,721999 | 0,072928 | 0,649071 | 9,911850 | 8,205221 | 10,149029 |
|
7 | 10.000.000 | 7.175.153 | 615.643 | 6.559.510 | 0,717515 | 0,061564 | 0,655951 | 9,937899 | 8,441792 | 10,105998 |
|
8 | 100.000.000 | 71.419.128 | 5.328.644 | 66.090.484 | 0,714191 | 0,053286 | 0,660905 | 9,953673 | 8,655412 | 10,075521 |
|
9 | 1.000.000.000 | 711.654.088 | 47.034.083 | 664.620.005 | 0,711654 | 0,047034 | 0,664620 | 9,964475 | 8,826651 | 10,056213 |
|
10 | 10.000.000.000 | 7.096.508.558 | 420.950.239 | 6.675.558.319 | 0,709651 | 0,042095 | 0,667556 | 9,971851 | 8,949898 | 10,044173 |
|
11 | 100.000.000.000 | 70.804.162.734 | 3.809.286.970 | 66.994.875.764 | 0,708042 | 0,038093 | 0,669949 | 9,977324 | 9,049257 | 10,035846 |
|
12 | 1.000.000.000.000 | 706.718.272.259 | 34.788.375.186 | 671.929.897.073 | 0,706718 | 0,034788 | 0,671930 | 9,981310 | 9,132516 | 10,029572 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A | B | C | D | E | F | G | H | I | J | K |
|
2^n | x | all Primes | P(x)=x^2+2x-1 | P(x) | x^2+2x-1 | 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 | 3 | 3 | 0 | 0,750000 | 1,000000 | 0,000000 | 1,500000 | 1,500000 |
| |
3 | 8 | 7 | 5 | 2 | 0,875000 | 0,714286 | 0,250000 | 2,333333 | 1,666667 |
| |
4 | 16 | 13 | 7 | 6 | 0,812500 | 0,538462 | 0,375000 | 1,857143 | 1,400000 | 3,000000 |
|
5 | 32 | 25 | 12 | 13 | 0,781250 | 0,480000 | 0,406250 | 1,923077 | 1,714286 | 2,166667 |
|
6 | 64 | 47 | 20 | 27 | 0,734375 | 0,425532 | 0,421875 | 1,880000 | 1,666667 | 2,076923 |
|
7 | 128 | 99 | 32 | 67 | 0,773438 | 0,323232 | 0,523438 | 2,106383 | 1,600000 | 2,481481 |
|
8 | 256 | 192 | 54 | 138 | 0,750000 | 0,281250 | 0,539063 | 1,939394 | 1,687500 | 2,059701 |
|
9 | 512 | 385 | 97 | 288 | 0,751953 | 0,251948 | 0,562500 | 2,005208 | 1,796296 | 2,086957 |
|
10 | 1.024 | 766 | 161 | 605 | 0,748047 | 0,210183 | 0,590820 | 1,989610 | 1,659794 | 2,100694 |
|
11 | 2.048 | 1.529 | 289 | 1.240 | 0,746582 | 0,189012 | 0,605469 | 1,996084 | 1,795031 | 2,049587 |
|
12 | 4.096 | 3.031 | 545 | 2.486 | 0,739990 | 0,179809 | 0,606934 | 1,982341 | 1,885813 | 2,004839 |
|
13 | 8.192 | 6.055 | 961 | 5.094 | 0,739136 | 0,158712 | 0,621826 | 1,997691 | 1,763303 | 2,049075 |
|
14 | 16.384 | 12.028 | 1.792 | 10.236 | 0,734131 | 0,148986 | 0,624756 | 1,986457 | 1,864724 | 2,009423 |
|
15 | 32.768 | 23.979 | 3.332 | 20.647 | 0,731781 | 0,138955 | 0,630096 | 1,993598 | 1,859375 | 2,017097 |
|
16 | 65.536 | 47.802 | 6.081 | 41.721 | 0,729401 | 0,127212 | 0,636612 | 1,993494 | 1,825030 | 2,020681 |
|
17 | 131.072 | 95.373 | 11.388 | 83.985 | 0,727638 | 0,119405 | 0,640755 | 1,995168 | 1,872718 | 2,013015 |
|
18 | 262.144 | 190.165 | 21.318 | 168.847 | 0,725422 | 0,112103 | 0,644100 | 1,993908 | 1,871970 | 2,010442 |
|
19 | 524.288 | 379.424 | 40.220 | 339.204 | 0,723694 | 0,106003 | 0,646980 | 1,995236 | 1,886669 | 2,008943 |
|
20 | 1.048.576 | 756.830 | 76.224 | 680.606 | 0,721769 | 0,100715 | 0,649076 | 1,994681 | 1,895177 | 2,006480 |
|
21 | 2.097.152 | 1.510.983 | 144.182 | 1.366.801 | 0,720493 | 0,095423 | 0,651742 | 1,996463 | 1,891556 | 2,008212 |
|
22 | 4.194.304 | 3.016.015 | 274.311 | 2.741.704 | 0,719074 | 0,090951 | 0,653673 | 1,996062 | 1,902533 | 2,005928 |
|
23 | 8.388.608 | 6.021.461 | 522.318 | 5.499.143 | 0,717814 | 0,086743 | 0,655549 | 1,996496 | 1,904109 | 2,005739 |
|
24 | 16.777.216 | 12.024.149 | 998.286 | 11.025.863 | 0,716695 | 0,083023 | 0,657193 | 1,996882 | 1,911261 | 2,005015 |
|
25 | 33.554.432 | 24.014.126 | 1.910.299 | 22.103.827 | 0,715677 | 0,079549 | 0,658745 | 1,997158 | 1,913579 | 2,004725 |
|
26 | 67.108.864 | 47.964.118 | 3.660.832 | 44.303.286 | 0,714721 | 0,076324 | 0,660170 | 1,997329 | 1,916366 | 2,004326 |
|
27 | 134.217.728 | 95.809.662 | 7.032.025 | 88.777.637 | 0,713838 | 0,073396 | 0,661445 | 1,997528 | 1,920882 | 2,003861 |
|
28 | 268.435.456 | 191.402.094 | 13.530.333 | 177.871.761 | 0,713028 | 0,070691 | 0,662624 | 1,997733 | 1,924102 | 2,003565 |
|
29 | 536.870.912 | 382.404.759 | 26.076.182 | 356.328.577 | 0,712284 | 0,068190 | 0,663714 | 1,997913 | 1,927239 | 2,003289 |
|
30 | 1.073.741.824 | 764.060.580 | 50.322.316 | 713.738.264 | 0,711587 | 0,065862 | 0,664721 | 1,998042 | 1,929819 | 2,003034 |
|
31 | 2.147.483.648 | 1.526.721.093 | 97.225.942 | 1.429.495.151 | 0,710935 | 0,063683 | 0,665661 | 1,998168 | 1,932064 | 2,002828 |
|
32 | 4.294.967.296 | 3.050.855.611 | 188.053.713 | 2.862.801.898 | 0,710333 | 0,061640 | 0,666548 | 1,998306 | 1,934193 | 2,002666 |
|
33 | 8.589.934.592 | 6.096.874.075 | 364.114.625 | 5.732.759.450 | 0,709770 | 0,059722 | 0,667381 | 1,998414 | 1,936227 | 2,002500 |
|
34 | 17.179.869.184 | 12.184.701.718 | 705.755.394 | 11.478.946.324 | 0,709243 | 0,057921 | 0,668163 | 1,998516 | 1,938278 | 2,002342 |
|
35 | 34.359.738.368 | 24.352.361.189 | 1.369.222.761 | 22.983.138.428 | 0,708747 | 0,056225 | 0,668897 | 1,998601 | 1,940081 | 2,002199 |
|
36 | 68.719.476.736 | 48.672.746.201 | 2.658.892.862 | 46.013.853.339 | 0,708282 | 0,054628 | 0,669590 | 1,998687 | 1,941899 | 2,002070 |
|
37 | 137.438.953.472 | 97.285.241.791 | 5.167.654.611 | 92.117.587.180 | 0,707843 | 0,053119 | 0,670244 | 1,998762 | 1,943536 | 2,001953 |
|
38 | 274.877.906.944 | 194.456.825.258 | 10.051.629.448 | 184.405.195.810 | 0,707430 | 0,051691 | 0,670862 | 1,998832 | 1,945105 | 2,001846 |
|
39 | 549.755.813.888 | 388.698.691.722 | 19.566.137.344 | 369.132.554.378 | 0,707039 | 0,050338 | 0,671448 | 1,998895 | 1,946564 | 2,001747 |
|
40 | 1.099.511.627.776 | 776.990.581.755 | 38.114.025.483 | 738.876.556.272 | 0,706669 | 0,049053 | 0,672004 | 1,998953 | 1,947959 | 2,001656 |
|
| |||||||||||
| |||||||||||