Re: How to count

*To*: mathgroup at smc.vnet.net*Subject*: [mg125719] Re: How to count*From*: "Harvey P. Dale" <hpd1 at nyu.edu>*Date*: Fri, 30 Mar 2012 04:31:50 -0500 (EST)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*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 at csl.pl] Sent: Thursday, March 29, 2012 3:55 AM To: mathgroup at smc.vnet.net Subject: [mg125719] 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

**References**:**How to count***From:*Artur <grafix@csl.pl>