login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A160093 Number of digits in n, excluding any trailing zeros. 27
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, 3, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,11

LINKS

Indranil Ghosh, Table of n, a(n) for n = 1..10000

FORMULA

From Hieronymus Fischer, Jun 08 2012: (Start)

With m = floor(log_10(n)), frac(x) = x-floor(x):

a(n) = 1 + Sum_{j=0..m} ceiling(frac(n/10^j)).

a(n) = 1 - Sum_{j=1..m} (floor(-frac(n/10^j))).

a(n)= A055642(n) + A054899(n-1) - A054899(n).

G.f.: g(x) = (x/(1-x)) + (1/(1-x))*Sum_{j>0} x^(10^j+1)*(1 - x^(10^j-1))/(1-x^10^j). (End)

a(n) = A055642(A004086(n)). - Indranil Ghosh, Jan 11 2017

EXAMPLE

a(1060000) = 3 because discarding the trailing zeros from 1060000 leaves 106, which is a 3-digit number.

MATHEMATICA

lnzd[n_]:=Module[{spl=Last[Split[IntegerDigits[n]]]}, If[!MemberQ[ spl, 0], IntegerLength[n], IntegerLength[n]-Length[spl]]]; Array[lnzd, 110] (* Harvey P. Dale, Jun 05 2013 *)

PROG

(Python)

def A160093(n):

     return len(str(int(str(n)[::-1]))) # Indranil Ghosh, Jan 11 2017

(PARI) a(n)=if(n==0, 1, #digits(n/10^valuation(n, 10))) \\ Joerg Arndt, Jan 11 2017

(PARI) a(n)=logint(n, 10)+1-valuation(n, 10) \\ Charles R Greathouse IV, Jan 12 2017

CROSSREFS

Cf. A054899, A055640, A055641, A055642, A102669, A122840, A122841, A160094, A196563, A196564.

Sequence in context: A231072 A055640 A098378 * A259143 A035931 A254524

Adjacent sequences:  A160090 A160091 A160092 * A160094 A160095 A160096

KEYWORD

base,easy,nonn

AUTHOR

Anonymous, May 01 2009

EXTENSIONS

Simpler definition and changed example from Jon E. Schoenfield, Feb 15 2014

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified June 19 08:41 EDT 2018. Contains 305581 sequences. (Running on oeis4.)