Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6629 > unrolled thread

Re: How to do quickest

Started byArtur <grafix@csl.pl>
First post2011-11-22 12:23 +0000
Last post2011-11-22 12:23 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to do quickest Artur <grafix@csl.pl> - 2011-11-22 12:23 +0000

#6629 — Re: How to do quickest

FromArtur <grafix@csl.pl>
Date2011-11-22 12:23 +0000
SubjectRe: How to do quickest
Message-ID<jag47e$51$1@smc.vnet.net>
Mathematical problem is described here:
https://oeis.org/draft/A200656
Best wishes
Artur

W dniu 2011-11-22 10:06, Andrzej Kozlowski pisze:
> On 21 Nov 2011, at 10:29, Artur wrote:
>
>> Dear Mathematica Gurus,
>> How to do quickest following procedure (which is very slowly):
>>
>> qq = {}; Do[y = Round[Sqrt[x^3]];
>>   If[(x^3 - y^2) != 0,
>>    kk = m /. Solve[{4 m^2 + 6 m n + n^2 ==
>>          x, (19 m^2 + 9 m n + n^2) Sqrt[m^2 + n^2] == y}, {m, n}][[1]];
>>     ll = CoefficientList[MinimalPolynomial[kk][[1]], #1];
>>    lll = Length[ll];
>>    If[lll<  12, Print[{x/(x^3 - y^2)^2, kk, x, y, x^3 - y^2}];
>>     If[Length[ll] == 3, Print[{kk, x, y}]]]], {x, 2, 1000000}];
>>   qq
>>
>>
>> (*Best wishes Artur*)
>>
> I think it would be better to send not only the code but also the mathematical problem, as there may be a way to do it in a different way. Unless I am misunderstanding something, what you are trying to do is the same as this:
>
> In[31]:= Block[{y = Round[Sqrt[x^3]]},
>    Reap[Table[
>       If[(x^3 - y^2) != 0&&  Not[IrreduciblePolynomialQ[poly]],
>        Sow[{x, y}]], {x, 2, 1000000}]][[2]]] // Timing
>
> Out[31]= {721.327,{}}
>
> This ought to be a lot faster than your code, but I have not tried to run yours to the end. Also, it is possible that using the Eisenstein Test explicitly may be somewhat faster:
>
> Block[{y = Round[Sqrt[x^3]]},
>     Reap[Table[
>      If[x^3 - y^2 != 0&&  Mod[x^6 - 2*x^3*y^2 + y^4, 4] == 0&&
>                ! IrreduciblePolynomialQ[poly], Sow[{x, y}]], {x, 2,
>       1000000}]][[2]]]
>
> {}
>
> but I forgot to use Timing and don't want to wait again, particularly that the answer is the empty set.
>
> Andrzej Kozlowski

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web