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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A160094 1 + the number of trailing zeros in n (A122840). 28
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,10

COMMENTS

Previous name: "a(n) is the number of digits from the right in n, when n is written in base 10, that the last nonzero digit of n (counting from left to right) occurs at."

a(n) is the Levenshtein distance from the decimal expansion of n - 1 to the decimal expansion of n. For example, to convert "9" to "10", substitute "0" for "9" and insert "1". Since two such operations are required, a(10) = 2. See the analogous A091090 (binary expansion) and A115777 (full definition). - Rick L. Shepherd, Mar 25 2015

LINKS

Rick L. Shepherd, 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) = sum_{j=0..m} (1 - ceiling(frac(n/10^j))).

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

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

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

EXAMPLE

a(160) = 2 because the last nonzero digit of 160 (counting from left to right), when 160 is written in base 10, is 6, and that 6 occurs 2 digits from the right in 160.

MATHEMATICA

IntegerExponent[Range[150]]+1 (* Harvey P. Dale, Feb 06 2015 *)

PROG

(Other)

For(n := 1, n < 10001, Inc(n), Echo(n +> ' ' +> Levenshtein(n-1, n)))

Copy the above line into an editing buffer of Notepad++ with the NppCalc plugin installed and ActiveCalc enabled. Position the cursor at the end of the line and press enter to duplicate the contents of this b-file. - Rick L. Shepherd, Mar 25 2015

CROSSREFS

Cf. A054899, A055640, A055641, A102669, A122840, A122841, A160093, A196563, A196564, A091090, A115777.

Sequence in context: A171398 A113607 A082586 * A043283 A127937 A250209

Adjacent sequences:  A160091 A160092 A160093 * A160095 A160096 A160097

KEYWORD

base,easy,nonn

AUTHOR

Anonymous, May 01 2009

EXTENSIONS

Name simplified by Jon E. Schoenfield, Feb 26 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 21 23:16 EDT 2018. Contains 305646 sequences. (Running on oeis4.)