Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9309
| From | "Harvey P. Dale" <hpd1@nyu.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: How to count |
| Date | 2012-03-30 09:32 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jl3ujt$3fq$1@smc.vnet.net> (permalink) |
| References | <201203290755.CAA21655@smc.vnet.net> |
Artur:
Your code requires computing n! twice for each n. You might try
something like this instead:
ss[n_]:=Module[{nf=n!},(Floor[Sqrt[nf]]+1)^2-nf]
But for large n, Mathematica cannot compute n! because of overflow.
Best,
Harvey
-----Original Message-----
From: Artur [mailto:grafix@csl.pl]
Sent: Thursday, March 29, 2012 3:55 AM
Subject: How to count
Dear Mathematica Gurus!
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?
Best wishes
Artur
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: How to count "Harvey P. Dale" <hpd1@nyu.edu> - 2012-03-30 09:32 +0000
csiph-web