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!)
A004218 log_10(n) rounded up. 8
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,11

COMMENTS

a(n) is the number of terms in the sequence A011557 (Powers of 10) that are less than n. For n > 1, a(n) is the number of digits in n-1. - Tanya Khovanova, Jun 22 2007

LINKS

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

FORMULA

a(n) = if n == 1 then 0 else 1 + A004216(n-1). - Reinhard Zumkeller, Dec 22 2012

a(n) = A055642(n-1) for all n > 1. a(n+1) is the number of decimal digits of n if 0 is considered to have 0 digits. - M. F. Hasler, Dec 07 2018

EXAMPLE

From M. F. Hasler, Dec 07 2018: (Start)

log_10(1) = 0, therefore a(1) = 0.

log_10(2) = 0.301..., therefore a(2) = 1.

log_10(9) = 0.954..., therefore a(9) = 1.

log_10(10) = 1, therefore a(10) = 1.

log_10(11) = 1.04..., therefore a(11) = 2.

log_10(99) = 1.9956..., therefore a(99) = 2.

log_10(100) = 2, therefore a(100) = 2.

log_10(101) = 2.004..., therefore a(101) = 3. (End)

MATHEMATICA

Array[Ceiling[Log10[#]] &, 100] (* Amiram Eldar, Dec 08 2018 *)

PROG

(Haskell) a004218 n = if n == 1 then 0 else 1 + a004216 (n - 1)

(PARI) A004218(n)=logint(n-(n>1), 10)+1 \\ M. F. Hasler, Dec 07 2018

CROSSREFS

Cf. A004216, A007953, A055642.

Sequence in context: A231560 A113679 A262438 * A044931 A178487 A280560

Adjacent sequences: A004215 A004216 A004217 * A004219 A004220 A004221

KEYWORD

nonn

AUTHOR

N. J. A. Sloane

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 5 06:15 EST 2022. Contains 358578 sequences. (Running on oeis4.)