This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A160094 #38 Jun 28 2025 09:11:38 %S A160094 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, %T A160094 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, %U A160094 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 %N A160094 a(n) = 1 + A122840(n). %C A160094 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 %H A160094 Rick L. Shepherd, <a href="/A160094/b160094.txt">Table of n, a(n) for n = 1..10000</a> %F A160094 From _Hieronymus Fischer_, Jun 08 2012: (Start) %F A160094 With m = floor(log_10(n)), frac(x) = x-floor(x): %F A160094 a(n) = Sum_{j=0..m} (1 - ceiling(frac(n/10^j))). %F A160094 a(n) = m + 1 + Sum_{j=1..m} (floor(-frac(n/10^j))). %F A160094 a(n) = 1 + A054899(n) - A054899(n-1). %F A160094 G.f.: g(x) = (x/(1-x)) + Sum_{j>0} x^10^j/(1-x^10^j). (End) %F A160094 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 10/9. - _Amiram Eldar_, Jul 10 2023 %F A160094 a(n) = A122840(10*n). - _R. J. Mathar_, Jun 28 2025 %e A160094 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. %t A160094 IntegerExponent[Range[150]]+1 (* _Harvey P. Dale_, Feb 06 2015 *) %o A160094 (Notepad++) %o A160094 For(n := 1, n < 10001, Inc(n), Echo(n +> ' ' +> Levenshtein(n-1, n))) %o A160094 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 %Y A160094 Cf. A054899, A055640, A055641, A102669, A122840, A122841, A160093, A196563, A196564, A091090, A115777. %K A160094 base,easy,nonn %O A160094 1,10 %A A160094 Anonymous, May 01 2009 %E A160094 Name simplified by _Jon E. Schoenfield_, Feb 26 2014