login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004216 a(n) = floor(log_10(n)). 25
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,100

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = if n > 9 then a(floor(n/10)) + 1, else 0. - Reinhard Zumkeller, Oct 31 2001

a(n) = A055642(n) - 1. - L. Edson Jeffery, Jul 09 2014

G.f.: (1/(1 - x))*Sum_{k>=1} x^(10^k). - Ilya Gutkovskiy, Jan 08 2017

MATHEMATICA

Table[ Length[ IntegerDigits[n, 10] ] - 1, {n, 105}] (* Jean-François Alcover, Jun 10 2013 *)

Table[Floor[Log10[n]], {n, 105}] (* L. Edson Jeffery, Jul 09 2014 *)

PROG

(Haskell)

a004216 n = if n <= 9 then 0 else 1 + a004216 (n `div` 10)

-- Reinhard Zumkeller, Dec 22 2012

(PARI) a(n) = logint(n, 10); \\ Michel Marcus, Oct 16 2021

CROSSREFS

Cf. A055642.

Sequence in context: A329030 A027388 A114295 * A076489 A211666 A297037

Adjacent sequences: A004213 A004214 A004215 * A004217 A004218 A004219

KEYWORD

nonn

AUTHOR

N. J. A. Sloane

EXTENSIONS

More terms from James A. Sellers, Sep 19 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 7 22:27 EST 2022. Contains 358671 sequences. (Running on oeis4.)