MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: number of digits in n^p

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60463] Re: [mg60415] number of digits in n^p
  • From: "Ingolf Dahl" <ingolf.dahl at telia.com>
  • Date: Sat, 17 Sep 2005 02:31:45 -0400 (EDT)
  • Reply-to: <ingolf.dahl at telia.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Not extremely difficult!

The function (Floor[Log[10, x]] + 1) gives the number of digits (before the
decimal point) of a positive number.

Use the logarithm laws to obtain

digitsofpower[n_Integer /; n > 0, p_Integer /; p >= 0] :=
Floor[p*Log[10,n]]+ 1

E.g.

digitsofpower[67, 89] 

returns 163

Best regards

Ingolf Dahl
Sweden

-----Original Message-----
From: George [mailto:orangepi77 at yahoo.com] 
To: mathgroup at smc.vnet.net
Subject: [mg60463] [mg60415] number of digits in n^p


i wonder if there is a formula, a function, or a method in mathematica to
know the number of digits in  n raised to the power of p without calculating
the result, such as 67^89 will give us a number with 163 digits in it, is
there a way to know this result without actually calculating 67^89
thanks
George
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




  • Prev by Date: Re: Strange Elements in Table
  • Next by Date: Re: Complete solution to a modular System of equations
  • Previous by thread: Re: number of digits in n^p
  • Next by thread: Re: number of digits in n^p