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+44x-421
f(0)=421
f(1)=47
f(2)=7
f(3)=5
f(4)=229
f(5)=11
f(6)=1
f(7)=1
f(8)=1
f(9)=1
f(10)=17
f(11)=23
f(12)=251
f(13)=1
f(14)=1
f(15)=29
f(16)=1
f(17)=1
f(18)=139
f(19)=97
f(20)=859
f(21)=59
f(22)=1031
f(23)=1
f(24)=173
f(25)=163
f(26)=1399
f(27)=1
f(28)=1
f(29)=53
f(30)=257
f(31)=1
f(32)=2011
f(33)=1
f(34)=1
f(35)=293
f(36)=2459
f(37)=1
f(38)=1
f(39)=1
f(40)=2939
f(41)=383
f(42)=3191
f(43)=83
f(44)=1
f(45)=1
f(46)=3719
f(47)=241
f(48)=1
f(49)=1
f(50)=389
f(51)=79
f(52)=653
f(53)=1
f(54)=4871
f(55)=157
f(56)=5179
f(57)=1
f(58)=1
f(59)=101
f(60)=1
f(61)=1
f(62)=6151
f(63)=1
f(64)=6491
f(65)=1
f(66)=977
f(67)=877
f(68)=1439
f(69)=461
f(70)=7559
f(71)=1
f(72)=103
f(73)=1
f(74)=8311
f(75)=1063
f(76)=8699
f(77)=1
f(78)=107
f(79)=1
f(80)=1
f(81)=1213
f(82)=1
f(83)=1
f(84)=10331
f(85)=659
f(86)=1
f(87)=1
f(88)=2239
f(89)=1427
f(90)=113
f(91)=1483
f(92)=1
f(93)=1
f(94)=1
f(95)=1
f(96)=277
f(97)=1657
f(98)=2699
f(99)=1
b) Substitution of the polynom
The polynom f(x)=x^2+44x-421 could be written as f(y)= y^2-905 with x=y-22
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+22
f'(x)>2x+43