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.

Showing 1-10 of 11 results. Next

A043489 Numbers having one 0 in base 10.

Original entry on oeis.org

0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 120, 130, 140, 150, 160, 170, 180, 190, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 220, 230, 240, 250, 260, 270, 280, 290, 301, 302, 303
Offset: 1

Views

Author

Keywords

Comments

From Hieronymus Fischer, May 28 2014: (Start)
Inversion:
Given a term m, the index n such that a(n) = m can be calculated by the following procedure [see Prog section with an implementation in Smalltalk]. With k := floor(log_10(m)), z = digit position of the '0' in m counted from the right (starting with 0).
Case 1: A043489_inverse(m) = 1 + Sum_{j=1..k} A052382_inverse(floor(m/10^j))*9^(j-1), if z = 0.
Case 2: A043489_inverse(m) = 1 + A043489_inverse(m - c - m mod 10^z) + A052382_inverse(m mod 10^z)) - (9^z - 1)/8, if z > 0, where c := 1, if the digit at position z+1 of m is ‘1’ and k > z + 1, otherwise c := 10.
Example 1: m = 990, k = 2, z = 0 (Case 1), A043489_inverse(990) = 1 + A052382_inverse(99))*1 + A052382_inverse(9))*9 = 1 + 90 + 81 = 172.
Example 2: m = 1099, k = 3, z = 2 (Case 2), A043489_inverse(1099) = 1 + A043489_inverse(990) + A052382_inverse(99)) - 10 = 1 + A043489_inverse(990) + 80 = 1 + 172 + 80 = 253.
(End)

Examples

			a(10^1)= 90.
a(10^2)= 590.
a(10^3)= 4190.
a(10^4)= 35209.
a(10^5)= 308949.
a(10^6)= 2901559.
a(10^7)= 27250269.
a(10^8)= 263280979.
a(10^9)= 2591064889.
a(10^10)= 25822705899.
a(10^20)= 366116331598324670219.
a(10^50)= 3.7349122484477433715662812...*10^51
a(10^100)= 4.4588697999177752943575344...*10^103.
a(10^1000)= 5.5729817962143143812258616...*10^1045.
[Examples by _Hieronymus Fischer_, May 28 2014]
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,9000],DigitCount[#,10,0]==1&] (* Enrique Pérez Herrero, Nov 29 2013 *)
  • PARI
    is(n)=#select(d->d==0, digits(n))==1 \\ Charles R Greathouse IV, Oct 06 2016
  • Smalltalk
    A043489_nextTerm
      "Answers the minimal number > m which contains exactly 1 zero digit (in base 10), where m is the receiver.
      Usage: a(n) A043489_nextTerm
      Answer: a(n+1)"
      | d d0 s n p |
      n := self.
      p := 1.
      s := n.
      (d0 := n // p \\ 10) = 0
         ifTrue:
              [p := 10 * p.
              s := s + 1].
      [(d := n // p \\ 10) = 9] whileTrue:
              [s := s - (8 * p).
              p := 10 * p].
      (d = 0 or: [d0 = 0]) ifTrue: [s := s - (p // 10)].
      ^s + p
    [by Hieronymus Fischer, May 28 2014]
    ------------------
    
  • Smalltalk
    A043489
    "Answers the n-th number such that number of 0's in base 10 is 1, where n is the receiver. Uses the method zerofree: base from A052382.
      Usage: n A043489
      Answer: a(n)"
      | n a b dj cj gj ej j r |
      n := self.
      n <= 1 ifTrue: [^r := 0].
      n <= 10 ifTrue: [^r := (n - 1) * 10].
      j := n invGeometricSum2: 9.
      b := j geometricSum2: 9.
      cj := 9 ** j.
      dj := (j + 1) * cj.
      gj := (cj - 1) / 8.
      ej := 10 ** j.
      a := n - b - 2.
      b := a \\ dj.
      r := (a // dj + 1) * ej * 10.
      [b >= cj] whileTrue:
              [a := b - cj.
              cj := cj // 9.
              dj := j * cj.
              b := a \\ dj.
              r := (a // dj + 1) * ej + r.
              gj := gj - cj.
              ej := ej // 10.
              j := j - 1].
      r := (b + gj zerofree: 10) + r.
      ^r
    [by Hieronymus Fischer, May 28 2014]
    ------------------
    
  • Smalltalk
    A043489_inverse
      "Answers the index n such that A043489(n) = m, where m is the receiver. Uses A052382_inverse from A052382.
      Usage: n zerofree_inverse: b [b = 10 for this sequence]
      Answer: a(n)"
      | m p q s r m1 mr |
      m := self.
      m < 100 ifTrue: [^m // 10 + 1].
      p := q := 1.
      s := 0.
      [m // p \\ 10 = 0] whileFalse:
         [p := 10 * p.
         s := s + q.
         q := 9 * q].
      p > 1
         ifTrue:
         [r := m \\ p.
         p := 10 * p.
         m1 := m // p.
         (m1 \\ 10 = 1 and: [m1 > 10])
              ifTrue: [mr := m - r - 1]
              ifFalse: [mr := m - r - 10].
         ^mr A043489_inverse + r A052382_inverse - s + 1]
         ifFalse:
         [s := 1.
         p := 10.
         q := 1.
         [p < m] whileTrue:
              [s := (m // p) A052382_inverse * q + s.
              p := 10 * p.
              q := 9 * q].
         ^s]
    [by Hieronymus Fischer, May 28 2014]
    

Formula

From Hieronymus Fischer, May 28 2014: (Start)
a(1 + Sum_{j=1..n} j*9^j) = 10*(10^n - 1).
a(2 + Sum_{j=1..n} j*9^j) = 10^(n+1) + (10^n - 1)/9 = (91*10^n - 1)/9.
a((9^(n+1) - 1)/8 + 1 + Sum_{j=1..n} j*9^j) = 10*(10^(n+1) - 1)/9, where Sum_{j=1..n} j*9^j = (1-(n+1)*9^n+n*9^(n+1))*9/64.
Iterative calculation:
With i := digit position of the '0' in a(n) counted from the right (starting with 0), j = number of contiguous '9' digits in a(n) counted from position 1, if i = 0, and counted from position 0, if i > 0 (0 if none)
a(n+1) = a(n) + 10 + (10^j - 1)/9, if i = 0.
a(n+1) = a(n) + 1 + (10^(j-1) - 1)/9, if i = j > 0.
a(n+1) = a(n) + 1 + (10^j - 1)/9, if i > j.
[see Prog section for an implementation in Smalltalk].
Direct calculation:
Set j := max( m | (Sum_{i=1..m} i*9^i) < n) and c(1) := n - 2 - Sum_{i=1..j} i*9^i. Define successively,
c(i+1) = c(i) mod ((j-i+2)*9^(j-i+1)) - 9^(j-i+1) while this value is >= 0, and set k := i for the last such index for which c(i) >= 0.
Then a(n) = A052382(c(k) mod ((j-k+2)*9^(j-k+1)) + (9^(j-k+1)-1)/8) + Sum_{i=1..k} ((floor(c(i)/((j-i+2)*9^(j-i+1))) + 1) * 10^(j-i+2)). [see Prog section for an implementation in Smalltalk].
Behavior for large n:
a(n) = O(n^(log(10)/log(9))/log(n)).
a(n) = O(n^1.047951651.../log(n)).
Inequalities:
a(n) < 2*(8n)^log_9(10)/(log_9(8n)*log_9(10)).
a(n) < (8n)^log_9(10)/(log_9(8n)*log_9(10)), for large n (n > 10^50).
a(n) > 0.9*(8n)^log_9(10)/(log_9(8n)*log_9(10)), for 2 < n < 10^50.
a(n) >= A011540(n), equality holds for n <= 10.
(End)

A043493 Numbers that contain a single 1.

Original entry on oeis.org

1, 10, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91, 100, 102, 103, 104, 105, 106, 107, 108, 109, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 132, 133, 134, 135, 136, 137, 138, 139, 140, 142, 143, 144, 145
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) >> n^k where k = log(10)/log(9) = 1.04795.... - Charles R Greathouse IV, Jan 21 2025

A043509 Numbers having exactly one 5 in base 10.

Original entry on oeis.org

5, 15, 25, 35, 45, 50, 51, 52, 53, 54, 56, 57, 58, 59, 65, 75, 85, 95, 105, 115, 125, 135, 145, 150, 151, 152, 153, 154, 156, 157, 158, 159, 165, 175, 185, 195, 205, 215, 225, 235, 245, 250, 251, 252, 253, 254, 256, 257, 258, 259
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) ≍ n^k log n, with k = log 9/log 10 = 0.9542425... = A104139. - Charles R Greathouse IV, Nov 01 2022

A043521 Numbers having one 8 in base 10.

Original entry on oeis.org

8, 18, 28, 38, 48, 58, 68, 78, 80, 81, 82, 83, 84, 85, 86, 87, 89, 98, 108, 118, 128, 138, 148, 158, 168, 178, 180, 181, 182, 183, 184, 185, 186, 187, 189, 198, 208, 218, 228, 238, 248, 258, 268, 278, 280, 281, 282, 283, 284, 285, 286, 287, 289, 298, 308, 318
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[300],DigitCount[#,10,8]==1&] (* Harvey P. Dale, Jan 06 2012 *)
  • PARI
    is(n)=my(d=digits(n)); sum(i=1,#d, d[i]==8)==1 \\ Charles R Greathouse IV, Feb 12 2017
    
  • Python
    def ok(n): return str(n).count('8') == 1
    print(list(filter(ok, range(320)))) # Michael S. Branicky, Aug 18 2021

A043497 Numbers having one 2 in base 10.

Original entry on oeis.org

2, 12, 20, 21, 23, 24, 25, 26, 27, 28, 29, 32, 42, 52, 62, 72, 82, 92, 102, 112, 120, 121, 123, 124, 125, 126, 127, 128, 129, 132, 142, 152, 162, 172, 182, 192, 200, 201, 203, 204, 205, 206, 207, 208, 209, 210, 211, 213, 214, 215
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

A043501 Numbers having one 3 in base 10.

Original entry on oeis.org

3, 13, 23, 30, 31, 32, 34, 35, 36, 37, 38, 39, 43, 53, 63, 73, 83, 93, 103, 113, 123, 130, 131, 132, 134, 135, 136, 137, 138, 139, 143, 153, 163, 173, 183, 193, 203, 213, 223, 230, 231, 232, 234, 235, 236, 237, 238, 239, 243, 253
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

A043505 Numbers having one 4 in base 10.

Original entry on oeis.org

4, 14, 24, 34, 40, 41, 42, 43, 45, 46, 47, 48, 49, 54, 64, 74, 84, 94, 104, 114, 124, 134, 140, 141, 142, 143, 145, 146, 147, 148, 149, 154, 164, 174, 184, 194, 204, 214, 224, 234, 240, 241, 242, 243, 245, 246, 247, 248, 249, 254
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

A043517 Numbers having one 7 in base 10.

Original entry on oeis.org

7, 17, 27, 37, 47, 57, 67, 70, 71, 72, 73, 74, 75, 76, 78, 79, 87, 97, 107, 117, 127, 137, 147, 157, 167, 170, 171, 172, 173, 174, 175, 176, 178, 179, 187, 197, 207, 217, 227, 237, 247, 257, 267, 270, 271, 272, 273, 274, 275, 276
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[9000],DigitCount[#,10,7]==1&]

A043525 Numbers having one 9 in base 10.

Original entry on oeis.org

9, 19, 29, 39, 49, 59, 69, 79, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 109, 119, 129, 139, 149, 159, 169, 179, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 209, 219, 229, 239, 249, 259, 269, 279, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 309, 319
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[300],DigitCount[#,10,9]==1&] (* Harvey P. Dale, Jan 19 2013 *)
  • Python
    def ok(n): return str(n).count('9') == 1
    print(list(filter(ok, range(320)))) # Michael S. Branicky, Sep 19 2021

Formula

Sum_{n>=1} 1/a(n) = A140502. - Amiram Eldar, Nov 14 2020

A316867 Number of times 6 appears in decimal expansion of n.

Original entry on oeis.org

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, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 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
Offset: 0

Views

Author

Robert G. Wilson v, Jul 15 2018

Keywords

Examples

			a(0) = 0 since the decimal representation of 0 does not contain the digit 6.
a(6) = 1 since 6 appears once in the decimal expansion of 6.
		

Crossrefs

Programs

  • Mathematica
    Array[ DigitCount[#, 10, 6] &, 105, 0]
  • PARI
    a(n) = #select(x->x==6, digits(n)); \\ Michel Marcus, Jul 20 2018
Showing 1-10 of 11 results. Next