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+184x-569
f(0)=569
f(1)=3
f(2)=197
f(3)=1
f(4)=61
f(5)=47
f(6)=571
f(7)=1
f(8)=967
f(9)=73
f(10)=457
f(11)=1
f(12)=1783
f(13)=83
f(14)=2203
f(15)=151
f(16)=877
f(17)=89
f(18)=3067
f(19)=137
f(20)=3511
f(21)=467
f(22)=1321
f(23)=131
f(24)=4423
f(25)=97
f(26)=67
f(27)=641
f(28)=1789
f(29)=701
f(30)=5851
f(31)=127
f(32)=6343
f(33)=103
f(34)=2281
f(35)=887
f(36)=7351
f(37)=317
f(38)=7867
f(39)=1
f(40)=2797
f(41)=541
f(42)=8923
f(43)=383
f(44)=9463
f(45)=1217
f(46)=71
f(47)=643
f(48)=10567
f(49)=113
f(50)=11131
f(51)=1427
f(52)=1
f(53)=1499
f(54)=173
f(55)=1
f(56)=211
f(57)=823
f(58)=1
f(59)=1721
f(60)=14071
f(61)=599
f(62)=14683
f(63)=937
f(64)=5101
f(65)=1
f(66)=179
f(67)=677
f(68)=16567
f(69)=2111
f(70)=5737
f(71)=1
f(72)=17863
f(73)=379
f(74)=18523
f(75)=2357
f(76)=6397
f(77)=2441
f(78)=19867
f(79)=421
f(80)=20551
f(81)=653
f(82)=1
f(83)=2699
f(84)=21943
f(85)=929
f(86)=22651
f(87)=719
f(88)=7789
f(89)=1483
f(90)=24091
f(91)=1019
f(92)=241
f(93)=1
f(94)=8521
f(95)=1621
f(96)=1
f(97)=139
f(98)=27067
f(99)=1
b) Substitution of the polynom
The polynom f(x)=x^2+184x-569 could be written as f(y)= y^2-9033 with x=y-92
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+92
f'(x)>2x+183