MathGroup Archive 2005

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

Search the Archive

Re: number of digits in n^p

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

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


digitsofpower[67, 89] 

returns 163

Best regards

Ingolf Dahl

-----Original Message-----
From: George [mailto:orangepi77 at] 
To: mathgroup at
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

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

  • 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