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


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

Re: How to count

Started by"Harvey P. Dale" <hpd1@nyu.edu>
First post2012-03-30 09:32 +0000
Last post2012-03-30 09:32 +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 count "Harvey P. Dale" <hpd1@nyu.edu> - 2012-03-30 09:32 +0000

#9309 — Re: How to count

From"Harvey P. Dale" <hpd1@nyu.edu>
Date2012-03-30 09:32 +0000
SubjectRe: How to count
Message-ID<jl3ujt$3fq$1@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

[toc] | [standalone]


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


csiph-web