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-24x-617
f(0)=617
f(1)=5
f(2)=661
f(3)=17
f(4)=41
f(5)=89
f(6)=29
f(7)=23
f(8)=149
f(9)=47
f(10)=757
f(11)=19
f(12)=761
f(13)=1
f(14)=1
f(15)=1
f(16)=1
f(17)=1
f(18)=1
f(19)=1
f(20)=1
f(21)=1
f(22)=1
f(23)=1
f(24)=1
f(25)=37
f(26)=113
f(27)=67
f(28)=101
f(29)=59
f(30)=1
f(31)=1
f(32)=1
f(33)=1
f(34)=277
f(35)=1
f(36)=1
f(37)=1
f(38)=1
f(39)=1
f(40)=1
f(41)=1
f(42)=139
f(43)=1
f(44)=263
f(45)=1
f(46)=79
f(47)=1
f(48)=107
f(49)=1
f(50)=683
f(51)=1
f(52)=839
f(53)=1
f(54)=1
f(55)=1
f(56)=1
f(57)=1
f(58)=271
f(59)=181
f(60)=1543
f(61)=1
f(62)=1
f(63)=1
f(64)=1
f(65)=1
f(66)=431
f(67)=283
f(68)=1
f(69)=311
f(70)=137
f(71)=1
f(72)=167
f(73)=1
f(74)=3083
f(75)=401
f(76)=1
f(77)=433
f(78)=719
f(79)=233
f(80)=3863
f(81)=1
f(82)=4139
f(83)=1
f(84)=4423
f(85)=571
f(86)=1
f(87)=1
f(88)=1
f(89)=1
f(90)=5323
f(91)=1
f(92)=5639
f(93)=1
f(94)=1
f(95)=383
f(96)=1259
f(97)=1
f(98)=1327
f(99)=1
b) Substitution of the polynom
The polynom f(x)=x^2-24x-617 could be written as f(y)= y^2-761 with x=y+12
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-12
f'(x)>2x-25 with x > 28
A | B | C | D | E | F | G | H |
exponent =log2 (x) |
<=x | number of all primes |
number of primes p = f(x) |
number of primes p | f(x) |
C / x | D / x | E / x |
1 | 2 | 3 | 2 | 1 | 1.5 | 1 | 0.5 |
2 | 4 | 5 | 2 | 3 | 1.25 | 0.5 | 0.75 |
3 | 8 | 9 | 2 | 7 | 1.125 | 0.25 | 0.875 |
4 | 16 | 13 | 4 | 9 | 0.8125 | 0.25 | 0.5625 |
5 | 32 | 18 | 4 | 14 | 0.5625 | 0.125 | 0.4375 |
6 | 64 | 28 | 10 | 18 | 0.4375 | 0.15625 | 0.28125 |
7 | 128 | 62 | 22 | 40 | 0.484375 | 0.171875 | 0.3125 |
8 | 256 | 144 | 37 | 107 | 0.5625 | 0.14453125 | 0.41796875 |
9 | 512 | 303 | 63 | 240 | 0.59179688 | 0.12304688 | 0.46875 |
10 | 1024 | 629 | 114 | 515 | 0.61425781 | 0.11132813 | 0.50292969 |
11 | 2048 | 1281 | 208 | 1073 | 0.62548828 | 0.1015625 | 0.52392578 |
12 | 4096 | 2618 | 374 | 2244 | 0.63916016 | 0.09130859 | 0.54785156 |
13 | 8192 | 5265 | 700 | 4565 | 0.6427002 | 0.08544922 | 0.55725098 |
14 | 16384 | 10583 | 1302 | 9281 | 0.64593506 | 0.07946777 | 0.56646729 |
15 | 32768 | 21252 | 2388 | 18864 | 0.64855957 | 0.07287598 | 0.57568359 |
16 | 65536 | 42737 | 4455 | 38282 | 0.65211487 | 0.06797791 | 0.58413696 |
17 | 131072 | 85923 | 8327 | 77596 | 0.65554047 | 0.06352997 | 0.5920105 |
18 | 262144 | 172481 | 15494 | 156987 | 0.6579628 | 0.05910492 | 0.59885788 |
19 | 524288 | 345952 | 29317 | 316635 | 0.65985107 | 0.05591774 | 0.60393333 |
20 | 1048576 | 693589 | 55506 | 638083 | 0.66145802 | 0.05293465 | 0.60852337 |
21 | 2097152 | 1390779 | 104800 | 1285979 | 0.66317511 | 0.04997253 | 0.61320257 |
22 | 4194304 | 2787212 | 199442 | 2587770 | 0.66452312 | 0.04755068 | 0.61697245 |
23 | 8388608 | 5584953 | 380356 | 5204597 | 0.66577828 | 0.04534197 | 0.62043631 |
24 | 16777216 | 11189123 | 726882 | 10462241 | 0.6669237 | 0.04332554 | 0.62359816 |