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 12 results. Next

A011531 Numbers that contain a digit 1 in their decimal representation.

Original entry on oeis.org

1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133
Offset: 1

Views

Author

Keywords

Comments

A121042(a(n)) = 1. - Reinhard Zumkeller, Jul 21 2006
See A043493 for numbers that contain a single digit '1'. A subsequence of numbers having a digit that divides all other digits, A263314. - M. F. Hasler, Jan 11 2016

Crossrefs

Programs

  • GAP
    Filtered([1..140],n->1 in ListOfDigits(n)); # Muniru A Asiru, Feb 23 2019
    
  • Haskell
    a011531 n = a011531_list !! (n-1)
    a011531_list = filter ((elem '1') . show) [0..]
    -- Reinhard Zumkeller, Feb 05 2012
    
  • Magma
    [n: n in [0..500] | 1 in Intseq(n) ]; // Vincenzo Librandi, Jan 11 2016
    
  • Maple
    M:= 3: # to get all terms of up to M digits
    B:= {1}: A:= {1}:
    for i from 2 to M do
       B:= map(t -> seq(10*t+j,j=0..9),B) union
          {seq(10*x+1,x=2*10^(i-2)..10^(i-1)-1)}:
       A:= A union B;
    od:
    sort(convert(A,list)); # Robert Israel, Jan 10 2016
    # second program:
    A011531 := proc(n)
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if nops(convert(convert(a,base,10),set) intersect {1}) > 0 then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Jul 31 2016
  • Mathematica
    Select[Range[600] - 1, DigitCount[#, 10, 1] > 0 &] (* Vincenzo Librandi, Jan 11 2016 *)
  • PARI
    is_A011531(n)=setsearch(Set(digits(n)),1) \\ M. F. Hasler, Jan 10 2016
    
  • Python
    def aupto(nn): return [m for m in range(1, nn+1) if '1' in str(m)]
    print(aupto(133)) # Michael S. Branicky, Jan 10 2021
  • Scala
    (0 to 119).filter(.toString.indexOf('1') > -1) // _Alonso del Arte, Jan 12 2020
    

Formula

a(n) ~ n. - Charles R Greathouse IV, Nov 02 2022

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)

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

A043513 Numbers having one 6 in base 10.

Original entry on oeis.org

6, 16, 26, 36, 46, 56, 60, 61, 62, 63, 64, 65, 67, 68, 69, 76, 86, 96, 106, 116, 126, 136, 146, 156, 160, 161, 162, 163, 164, 165, 167, 168, 169, 176, 186, 196, 206, 216, 226, 236, 246, 256, 260, 261, 262, 263, 264, 265, 267, 268
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[300],DigitCount[#,10,6]==1&] (* Harvey P. Dale, Aug 15 2011 *)

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

A178550 Primes with exactly one digit 1.

Original entry on oeis.org

13, 17, 19, 31, 41, 61, 71, 103, 107, 109, 127, 137, 139, 149, 157, 163, 167, 173, 179, 193, 197, 199, 241, 251, 271, 281, 313, 317, 331, 401, 419, 421, 431, 461, 491, 521, 541, 571, 601, 613, 617, 619, 631, 641, 661, 691, 701, 719, 751, 761, 821, 881, 919, 941, 971, 991
Offset: 1

Views

Author

Lekraj Beedassy, May 29 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[200]],Count[IntegerDigits[#],1]==1 &] (* Stefano Spezia, Aug 29 2025 *)
  • Python
    from sympy import isprime
    print([i for i in range(1000) if str(i).count('1') == 1 and isprime(i)]) # Daniel Starodubtsev, Mar 29 2020

Formula

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

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&]
Showing 1-10 of 12 results. Next