Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5348
| From | "Harvey P. Dale" <hpd1@nyu.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: count zeros in a number |
| Date | 2011-10-03 08:32 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j6brvm$8om$1@smc.vnet.net> (permalink) |
| References | <201110020636.CAA28027@smc.vnet.net> |
=09
zeroes[n_]:=Module[{idn=IntegerDigits[n]},If[Last[idn]==0,Length[Split[i
dn][[-1]]],0]]
zeroes[24^24 55^55]
Best,
Harvey
-----Original Message-----
From: dimitris [mailto:dimmechan@yahoo.com]
Sent: Sunday, October 02, 2011 2:37 AM
Subject: count zeros in a number
Hello.
Consider e.g. the number 24^24*55^55.
This number ends with exactly 55 zeros as the following demonstrate
In[201]:= Mod[24^24*55^55, 10^55]
Mod[24^24*55^55, 10^56]
Out[201]= 0
Out[202]= 20000000000000000000000000000000000000000000000000000000
What I want now is a way to count the zeros that a number ends without
knowing in advance this number of zeros like in the above example.
Thanks in advance.
Dimitris
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
Re: count zeros in a number "Harvey P. Dale" <hpd1@nyu.edu> - 2011-10-03 08:32 +0000 Re: count zeros in a number Richard Fateman <fateman@cs.berkeley.edu> - 2011-10-04 05:31 +0000 Re: count zeros in a number DrMajorBob <btreat1@austin.rr.com> - 2011-10-05 08:05 +0000 Re: count zeros in a number Richard Fateman <fateman@eecs.berkeley.edu> - 2011-10-05 08:08 +0000 Re: count zeros in a number DrMajorBob <btreat1@austin.rr.com> - 2011-10-05 08:09 +0000 Re: count zeros in a number DrMajorBob <btreat1@austin.rr.com> - 2011-10-05 08:11 +0000 Re: count zeros in a number Richard Fateman <fateman@eecs.berkeley.edu> - 2011-10-05 08:12 +0000 Re: count zeros in a number DrMajorBob <btreat1@austin.rr.com> - 2011-10-05 08:13 +0000
csiph-web