cp's OEIS Frontend

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.

Previous Showing 11-20 of 26 results. Next

A160094 a(n) = 1 + A122840(n).

Original entry on oeis.org

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
Offset: 1

Views

Author

Anonymous, May 01 2009

Keywords

Comments

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

Examples

			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.
		

Crossrefs

Programs

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

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)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 10/9. - Amiram Eldar, Jul 10 2023
a(n) = A122840(10*n). - R. J. Mathar, Jun 28 2025

Extensions

Name simplified by Jon E. Schoenfield, Feb 26 2014

A102683 Number of digits 9 in decimal representation of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Crossrefs

Programs

  • Haskell
    a102683 =  length . filter (== '9') . show
    -- Reinhard Zumkeller, Dec 29 2011
  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=9 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..116); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    a[n_] := DigitCount[n, 10, 9]; Array[a, 100, 0] (* Amiram Eldar, Jul 24 2023 *)

Formula

a(A007095(n)) = 0; a(A011539(n)) > 0. - Reinhard Zumkeller, Dec 29 2011
From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 1/10) - floor(n/10^j)), where m=floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(9*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)
a(A235049(n)) = 0. - Reinhard Zumkeller, Apr 16 2014

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102679 Number of digits >= 7 in decimal representation of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007093 (numbers in base 7). - Bernard Schott, Feb 12 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=7 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..125); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 3/10) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(7*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102681 Number of digits >= 8 in decimal representation of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007094 (numbers in base 8). - Bernard Schott, Feb 18 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=8 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..120); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 1/5) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(8*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102677 Number of digits >= 6 in decimal representation of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007092 (numbers in base 6). - Bernard Schott, Feb 02 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=6 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..116); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Table[Total@ Take[Most@ DigitCount@ n, -4], {n, 0, 104}] (* Michael De Vlieger, Aug 17 2017 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 2/5) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(6*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102684 Number of times the digit 9 appears in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

This is the total number of digits = 9 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=9 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i),i=0..n), n=0..105); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Accumulate[DigitCount[Range[0,100],10,9]] (* Harvey P. Dale, Mar 30 2018 *)
  • PARI
    a(n) = sum(k=0, n, #select(x->(x==9), digits(k))); \\ Michel Marcus, Oct 03 2023

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 1/10)*(2n + 2 - (4/5 + floor(n/10^j + 1/10))*10^j) - floor(n/10^j)*(2n + 2 - (1+floor(n/10^j)) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*A102683(n) + (1/2)*Sum_{j=1..m+1} ((-4/5*floor(n/10^j + 1/10) + floor(n/10^j))*10^j - (floor(n/10^j + 1/10)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m-1) = m*10^(m-1).
(this is total number of digits = 9 occurring in all the numbers with <= m places).
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(9*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005
Definition revised by N. J. A. Sloane, Mar 30 2018

A102670 Number of digits >= 2 in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30, 32, 34, 35, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 54, 56, 58, 60, 62, 64, 66, 68, 70, 71, 72, 74, 76, 78, 80, 82, 84, 86, 88, 89, 90, 92, 94, 96, 98, 100, 102, 104, 106, 107, 108
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of digits >= 2 occurring in all the numbers 0, 1, 2, ..., n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=2 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i),i=0..n), n=0..77); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Accumulate[Table[Count[IntegerDigits[n],?(#>1&)],{n,0,80}]] (* _Harvey P. Dale, Apr 17 2014 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 0.8)*(2n + 2 + ((3/5) - floor(n/10^j + 4/5))*10^j) - floor(n/10^j)*(2n + 2 - (1 + floor(n/10^j)) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)* A102669(n) + (1/2)*Sum_{j=1..m+1} (((3/5)*floor(n/10^j + 4/5) + floor(n/10^j))*10^j - (floor(n/10^j + 4/5)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m - 1) = 8*m*10^(m-1).
(This is the total number of digits >= 2 occurring in all the numbers with <= m places.)
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(2*10^j) - x^(10*10^j))/(1 - x^10^(j+1)).
General formulas for the total number of digits >= d in the decimal representations of all integers from 0 to n.
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + (10-d)/10) *(2n + 2 + ((5-d)/5 - floor(n/10^j + (10-d)/10))*10^j) - floor(n/10^j)*(2n + 2 - (1 + floor(n/10^j)) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*F(n,d) + (1/2)*Sum_{j=1..m+1} ((((5-d)/5)*floor(n/10^j + (10-d)/10) + floor(n/10^j))*10^j - (floor(n/10^j + (10-d)/10)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)) and F(n,d) = number of digits >= d in the decimal representation of n.
a(10^m - 1) = (10-d)*m*10^(m-1).
(This is the total number of digits >= d occurring in all the numbers with <= m places.)
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(d*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102671 Number of digits >= 3 in decimal representation of n.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007089 (numbers in base 3). - Bernard Schott, Nov 20 2022

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=3 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..116); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Table[Count[IntegerDigits[n],?(#>2&)],{n,0,110}] (* _Harvey P. Dale, Mar 07 2012 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor((n/10^j) + 7/10) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(3*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102672 Number of digits >= 3 in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 28, 30, 32, 34, 36, 38, 39, 40, 41, 43, 45, 47, 49, 51, 53, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 73, 74, 75, 77, 79, 81, 83, 85, 87, 89, 90, 91, 92, 94
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of digits >= 3 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Partial sums of A102671.
Cf. A000120, A000788, A023416, A059015 (for base 2).

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=3 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i),i=0..n), n=0..80); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Accumulate[Table[Count[IntegerDigits[n],?(#>2&)],{n,0,80}]] (* _Harvey P. Dale, Nov 23 2014 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 7/10)*(2n + 2 + (2/5 - floor(n/10^j + 7/10))*10^j) - floor(n/10^j)*(2n + 2 - (1 + floor(n/10^j)) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*A102671(n) + (1/2)*Sum_{j=1..m+1} (((2/5)*floor(n/10^j + 7/10) + floor(n/10^j))*10^j - (floor(n/10^j + 7/10)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m - 1) = 7*m*10^(m-1).
(This is the total number of digits >= 3 occurring in all the numbers with <= m places.)
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(3*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A102673 Number of digits >= 4 in decimal representation of n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 1
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007090 (numbers in base 4). - Bernard Schott, Feb 01 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=4 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..125); # Emeric Deutsch, Feb 22 2005
  • Mathematica
    Table[Total@ Take[DigitCount@ n, {4, 9}], {n, 0, 104}] (* Michael De Vlieger, Aug 17 2017 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 3/5) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(4*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 22 2005
Previous Showing 11-20 of 26 results. Next