Re: Quick help needed very much!!!!
- To: mathgroup at smc.vnet.net
- Subject: [mg94014] Re: [mg93992] Quick help needed very much!!!!
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Tue, 2 Dec 2008 00:40:49 -0500 (EST)
- References: <200811290929.EAA14420@smc.vnet.net> <200811301201.HAA07727@smc.vnet.net> <200812011201.HAA05879@smc.vnet.net>
Artur wrote: > Dear Mathematica Gurus, > > I was run 2 days ago procedure > aa = {}; bb = {}; Do[ > If[(Sqrt[n! + 1] /. Sqrt[_] -> 1) > 1, Print[n]; AppendTo[aa, n]; > AppendTo[bb, Sqrt[n! + 1] /. Sqrt[_] -> 1]], {n, 1, 10000000}]; aa > > Who know how interrupt these with possibility received information about > value last n checked or received recent value n without interrupting. > > If you know answer on my question send copy email answer also on my > private email, please! > > Best wishes > Artur You might print n every so often, say when it is a multiple of 100. This will give you a close bound on where it is upon interruption. Or you could replace Do with a For loop, and increase your index, n, in each step. If you interrupt, this index is not a scoped variable (the way it is in Do) and so you can simply check it's value. I will point out that if the purpose of your code is to find ALL n<=10000000 where n!+1 contains a square, there is no reason to believe it will work correctly. This is because there are numbers containing squares, for which Sqrt will not pull out those squares. Here is a fairly small example. Sqrt[Prime[11111]^2*Prime[22222]] If I recall correctly, all such examples will have squares that involve primes larger than Mathematica would use for trial division. Daniel Lichtblau Wolfram Research
- References:
- Quick help needed very much!!!!
- From: Artur <grafix@csl.pl>
- Quick help needed very much!!!!