       Reducible Trinomials How to do quickest algoritm

• To: mathgroup at smc.vnet.net
• Subject: [mg110548] Reducible Trinomials How to do quickest algoritm
• From: Artur <grafix at csl.pl>
• Date: Fri, 25 Jun 2010 07:26:24 -0400 (EDT)

```Dear Mathethica Gurus,

I'm looking for quick prcedure for finding trinoamials x^n +Ax +B for
large {n,50,1000} range which have cubic unreducible factor (x^3+p x^2+q
x+r).
My prcedure is ver slowly and for range n 183-190 need whole day
Here is
Timing[aa = {};
Do[Print[n];
kk = CoefficientList[
PolynomialRemainder[x^n + a x + b, x^3 + p x^2 + q x + r, x], x];
gg = Solve[{kk[] == 0, kk[] == 0, kk[] == 0}, {a, b, r}];
rr = (r /. gg[])[][]; rr = rr /. #1 -> y;(*Print[rr];*)
Do[Do[kk = FactorList[rr];
If[Length[kk] > 2,
Do[kkk = kk[[m]][];
If[Length[kkk] == 2, rrr = Solve[kkk == 0, y];(*Print[{-1, r->y/.
rrr[]}];*)
kkkk = CoefficientList[
PolynomialRemainder[
x^n + a x + b, (x^3 + p x^2 + q x + r) /. r -> y /.
rrr[], x], x];(*Print[kkkk];*)
bb = (b /. Solve[kkkk[] == 0, b])[];
aaa = (a /. Solve[kkkk[] == 0, a])[];(*Print[{bb,aaa}];*)
If[(bb != 0) && (aaa != 0),
AppendTo[
aa, {n, p, q, y /. rrr[], x^n + aaa x + bb,
Factor[x^n + aaa x + bb]}];
Print[{n, p, q, kkkk, kk}]]], {m, 2, Length[kk]}]], {p, -30,
30}], {q, -100, 100}], {n,
183, 1000}]; aa]

I will be  greatfuull for any help!
Largest know trinomials are x^52+2^34*3*53x+2^35*103 which have cubic
factor x^3+2x^2+4x+4
I don't find any more from 53 up to n=186.
Best wishes
Artur

```

• Prev by Date: Replacement rule limitations
• Next by Date: Re: ContourStyle Question
• Previous by thread: Re: Replacement rule limitations
• Next by thread: RandomReal[] and sampling a distribution