Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9302
| From | Costa Bravo <q13a27tt@aol.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: How to count |
| Date | 2012-03-30 09:37 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jl3utg$3k6$1@smc.vnet.net> (permalink) |
| References | <jl14ig$l5e$1@smc.vnet.net> |
Artur wrote:
> I have seriously problem with counting distances between smallest square
> bigger than n! (for big n) e.g.
>
> aa = {}; Do[k = 1 + Floor[Sqrt[n!]]; kk = k^2 - n!; Print[kk];
> kkk = N[Log[kk], 100]; Print[kkk];
> AppendTo[aa, kkk], {n, 1, 10000000, 1000000}]; aa
>
> Who have idea how to count this on Mathematica?
>
funa[n_]:=Module[{lg,lg1,ns},
lg=N[LogGamma[n+1]];
lg1=N[LogGamma[n+1],102+Round[lg/2/Log[10]]];
ns=Exp[lg1];
N[Log[(1+Floor[Sqrt[ns]])^2-ns],100]]
aa={};w = 5 (* 6 *);
Do[Print[k," ",Timing[kkk=funa[k]]];
AppendTo[aa,kkk],{k, 1 ,10^(w+1),10^w}];
OK ?!
--
Costa
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to count Artur <grafix@csl.pl> - 2012-03-29 07:56 +0000
Re: How to count Costa Bravo <q13a27tt@aol.com> - 2012-03-30 09:37 +0000
Re: How to count danl@wolfram.com - 2012-03-30 09:38 +0000
Re: How to count Costa Bravo <q13a27tt@aol.com> - 2012-04-01 07:38 +0000
Re: How to count danl@wolfram.com - 2012-04-03 08:55 +0000
csiph-web