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

A007088 The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.

Original entry on oeis.org

0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111
Offset: 0

Views

Author

Keywords

Comments

List of binary numbers. (This comment is to assist people searching for that particular phrase. - N. J. A. Sloane, Apr 08 2016)
Or, numbers that are sums of distinct powers of 10.
Or, numbers having only digits 0 and 1 in their decimal representation.
Complement of A136399; A064770(a(n)) = a(n). - Reinhard Zumkeller, Dec 30 2007
From Rick L. Shepherd, Jun 25 2009: (Start)
Nonnegative integers with no decimal digit > 1.
Thus nonnegative integers n in base 10 such that kn can be calculated by normal addition (i.e., n + n + ... + n, with k n's (but not necessarily k + k + ... + k, with n k's)) or multiplication without requiring any carry operations for 0 <= k <= 9. (End)
For n > 1: A257773(a(n)) = 10, numbers that are Belgian-k for k=0..9. - Reinhard Zumkeller, May 08 2015
For any integer n>=0, find the binary representation and then interpret as decimal representation giving a(n). - Michael Somos, Nov 15 2015
N is in this sequence iff A007953(N) = A101337(N). A028897 is a left inverse. - M. F. Hasler, Nov 18 2019
For n > 0, numbers whose largest decimal digit is 1. - Stefano Spezia, Nov 15 2023

Examples

			a(6)=110 because (1/2)*((1-(-1)^6)*10^0 + (1-(-1)^3)*10^1 + (1-(-1)^1)*10^2) = 10 + 100.
G.f. = x + 10*x^2 + 11*x^3 + 100*x^4 + 101*x^5 + 110*x^6 + 111*x^7 + 1000*x^8 + ...
.
  000    The numbers < 2^n can be regarded as vectors with
  001    a fixed length n if padded with zeros on the left
  010    side. This represents the n-fold Cartesian product
  011    over the set {0, 1}. In the example on the left,
  100    n = 3. (See also the second Python program.)
  101    Binary vectors in this format can also be seen as a
  110    representation of the subsets of a set with n elements.
  111    - _Peter Luschny_, Jan 22 2024
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 21.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §2.8 Binary, Octal, Hexadecimal, p. 64.
  • Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991, p. 383.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

The basic sequences concerning the binary expansion of n are this one, A000120 (Hammingweight: sum of bits), A000788 (partial sums of A000120), A000069 (A000120 is odd), A001969 (A000120 is even), A023416 (number of bits 0), A059015 (partial sums). Bisections A099820 and A099821.
Cf. A028897 (convert binary to decimal).

Programs

  • Haskell
    a007088 0 = 0
    a007088 n = 10 * a007088 n' + m where (n',m) = divMod n 2
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Maple
    A007088 := n-> convert(n, binary): seq(A007088(n), n=0..50); # R. J. Mathar, Aug 11 2009
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 39}]
    Table[Sum[ (Floor[( Mod[f/2 ^n, 2])])*(10^n) , {n, 0, Floor[Log[2, f]]}], {f, 1, 100}] (* José de Jesús Camacho Medina, Jul 24 2014 *)
    FromDigits/@Tuples[{1,0},6]//Sort (* Harvey P. Dale, Aug 10 2017 *)
  • PARI
    {a(n) = subst( Pol( binary(n)), x, 10)}; /* Michael Somos, Jun 07 2002 */
    
  • PARI
    {a(n) = if( n<=0, 0, n%2 + 10*a(n\2))}; /* Michael Somos, Jun 07 2002 */
    
  • PARI
    a(n)=fromdigits(binary(n),10) \\ Charles R Greathouse IV, Apr 08 2015
    
  • Python
    def a(n): return int(bin(n)[2:])
    print([a(n) for n in range(40)]) # Michael S. Branicky, Jan 10 2021
    
  • Python
    from itertools import product
    n = 4
    for p in product([0, 1], repeat=n): print(''.join(str(x) for x in p))
    # Peter Luschny, Jan 22 2024

Formula

a(n) = Sum_{i=0..m} d(i)*10^i, where Sum_{i=0..m} d(i)*2^i is the base 2 representation of n.
a(n) = (1/2)*Sum_{i>=0} (1-(-1)^floor(n/2^i))*10^i. - Benoit Cloitre, Nov 20 2001
a(n) = A097256(n)/9.
a(2n) = 10*a(n), a(2n+1) = a(2n)+1.
G.f.: 1/(1-x) * Sum_{k>=0} 10^k * x^(2^k)/(1+x^(2^k)) - for sequence as decimal integers. - Franklin T. Adams-Watters, Jun 16 2006
a(A000290(n)) = A001737(n). - Reinhard Zumkeller, Apr 25 2009
a(n) = Sum_{k>=0} A030308(n,k)*10^k. - Philippe Deléham, Oct 19 2011
For n > 0: A054055(a(n)) = 1. - Reinhard Zumkeller, Apr 25 2012
a(n) = Sum_{k=0..floor(log_2(n))} floor((Mod(n/2^k, 2)))*(10^k). - José de Jesús Camacho Medina, Jul 24 2014

A007089 Numbers in base 3.

Original entry on oeis.org

0, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110, 111, 112, 120, 121, 122, 200, 201, 202, 210, 211, 212, 220, 221, 222, 1000, 1001, 1002, 1010, 1011, 1012, 1020, 1021, 1022, 1100, 1101, 1102, 1110, 1111, 1112, 1120, 1121, 1122, 1200, 1201, 1202, 1210, 1211
Offset: 0

Views

Author

Keywords

Comments

Nonnegative integers with no decimal digit > 2. Thus nonnegative integers in base 10 whose quadrupling by normal addition or multiplication requires no carry operation. - Rick L. Shepherd, Jun 25 2009

References

  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §2.3 Positional Notation, p. 47.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007089 0 = 0
    a007089 n = 10 * a007089 n' + m where (n', m) = divMod n 3
    -- Reinhard Zumkeller, Feb 19 2012
    
  • Maple
    A007089 := proc(n) option remember;
    if n <= 0 then 0
    else
      if (n mod 3) = 0 then 10*procname(n/3) else procname(n-1) + 1 fi
    fi end:
    [seq(A007089(n), n=0..729)]; # - N. J. A. Sloane, Mar 09 2019
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 3]], {n, 0, 50}]
  • PARI
    a(n)=if(n<1,0,if(n%3,a(n-1)+1,10*a(n/3)))
    
  • PARI
    a(n)=fromdigits(digits(n,3)) \\ Charles R Greathouse IV, Jan 08 2017
    
  • Python
    def A007089(n):
      n,s = divmod(n,3); t = 1
      while n: n,r = divmod(n,3); t *= 10; s += r*t
      return s # M. F. Hasler, Feb 15 2023

Formula

a(0)=0, a(n) = 10*a(n/3) if n==0 (mod 3), a(n) = a(n-1) + 1 otherwise. - Benoit Cloitre, Dec 22 2002
a(n) = 10*a(floor(n/3)) + (n mod 3) if n > 0, a(0) = 0. - M. F. Hasler, Feb 15 2023

Extensions

More terms from James Sellers, May 01 2000

A007090 Numbers in base 4.

Original entry on oeis.org

0, 1, 2, 3, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, 33, 100, 101, 102, 103, 110, 111, 112, 113, 120, 121, 122, 123, 130, 131, 132, 133, 200, 201, 202, 203, 210, 211, 212, 213, 220, 221, 222, 223, 230, 231, 232, 233, 300, 301, 302, 303, 310, 311, 312, 313, 320, 321, 322, 323, 330, 331, 332, 333
Offset: 0

Views

Author

Keywords

Comments

Nonnegative integers with no decimal digit > 3. Thus nonnegative integers in base 10 whose tripling (trebling) by normal addition or multiplication requires no carry operation. - Rick L. Shepherd, Jun 25 2009
Interpreted in base 10: a(x)+a(y) = a(z) => x+y = z. The converse is not true in general. - Karol Bacik, Sep 27 2012

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A007608, A000042, A007088 (base 2), A007089 (base 3), A007091 (base 5), A007092 (base 6), A007093 (base 7), A007094 (base 8), A007095 (base 9), A193890, A107715.

Programs

  • Haskell
    a007090 0 = 0
    a007090 n = 10 * a007090 n' + m where (n', m) = divMod n 4
    -- Reinhard Zumkeller, Apr 08 2013, Aug 11 2011
  • Maple
    A007090 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,4): return op(convert(l,base,10,10^nops(l))): end: seq(A007090(n),n=0..54); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 4]], {n, 0, 60}]
  • PARI
    a(n)=if(n<1,0,if(n%4,a(n-1)+1,10*a(n/4)))
    
  • PARI
    A007090(n)=sum(i=1,#n=digits(n,4),n[i]*10^(#n-i)) \\ M. F. Hasler, Jul 25 2015 (Corrected by Jinyuan Wang, Oct 02 2019)
    
  • PARI
    apply( A007090(n)=fromdigits(digits(n,4)), [0..66]) \\ M. F. Hasler, Nov 18 2019
    

Formula

a(n) = Sum_{d(i)*10^i: i=0, 1, ..., m}, where Sum_{d(i)*4^i: i=0, 1, ..., m} is the base 4 representation of n.
a(0) = 0, a(n) = 10*a(n/4) if n==0 (mod 4), a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002

A007091 Numbers in base 5.

Original entry on oeis.org

0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 100, 101, 102, 103, 104, 110, 111, 112, 113, 114, 120, 121, 122, 123, 124, 130, 131, 132, 133, 134, 140, 141, 142, 143, 144, 200, 201, 202, 203, 204, 210, 211, 212, 213, 214, 220, 221, 222, 223, 224, 230
Offset: 0

Views

Author

Keywords

Comments

From Rick L. Shepherd, Jun 25 2009: (Start)
Nonnegative integers with no decimal digit > 4.
Thus nonnegative integers in base 10 whose doubling by normal addition or multiplication requires no carry operation. (End)
It appears that this sequence corresponds to the numbers n for which twice the sum of digits of n is the sum of digits of 2*n. - Rémy Sigrist, Nov 22 2009

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000042 (base 1), A007088 (base 2), A007089 (base 3), A007090 (base 4), A007092 (base 6), A007093 (base 7), A007094 (base 8), A007095 (base 9).

Programs

  • Maple
    A007091 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,5): return op(convert(l,base,10,10^nops(l))): end: seq(A007091(n),n=0..58); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 5]], {n, 0, 60}]
  • PARI
    a(n)=if(n<1,0,if(n%5,a(n-1)+1,10*a(n/5)))
    
  • PARI
    apply( A007091(n)=fromdigits(digits(n,5)), [0..66]) \\ M. F. Hasler, Nov 18 2019
    
  • Python
    from gmpy2 import digits
    def A007091(n): return int(digits(n,5)) # Chai Wah Wu, Dec 26 2021

Formula

a(0)=0 a(n)=10*a(n/5) if n==0 (mod 5) a(n)=a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002
a(n) = n + 1/2*Sum_{k >= 1} 10^k*floor(n/5^k). Cf. A037454, A037462 and A102491. - Peter Bala, Dec 01 2016

A007094 Numbers in base 8.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 62, 63, 64, 65, 66, 67, 70, 71, 72, 73, 74, 75, 76, 77, 100, 101, 102, 103, 104, 105, 106, 107, 110, 111
Offset: 0

Views

Author

Keywords

References

  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §2.8 Binary, Octal, Hexadecimal, p. 64.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A057104; A000042 (base 1), A007088 (base 2), A007089 (base 3), A007090 (base 4), A007091 (base 5), A007092 (base 6), A007093 (base 7), A007095 (base 9).

Programs

  • Haskell
    a007094 0 = 0
    a007094 n = 10 * a007094 n' + m where (n', m) = divMod n 8
    -- Reinhard Zumkeller, Aug 29 2013
    
  • Maple
    A007094 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,8): return op(convert(l,base,10,10^nops(l))): end: seq(A007094(n), n=0..66); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[FromDigits[IntegerDigits[n, 8]], {n, 0, 70}]
  • PARI
    a(n)=if(n<1,0,if(n%8,a(n-1)+1,10*a(n/8)))
    
  • PARI
    apply( A007094(n)=fromdigits(digits(n,8)), [0..77]) \\ M. F. Hasler, Nov 18 2019
    
  • Python
    def a(n): return int(oct(n)[2:])
    print([a(n) for n in range(74)]) # Michael S. Branicky, Jun 28 2021

Formula

a(0) = 0; a(n) = 10*a(n/8) if n == 0 (mod 8); a(n) = a(n-1) + 1 otherwise. - Benoit Cloitre, Dec 22 2002
G.f.: sum(d>=0, 10^d*(x^(8^d) +2*x^(2*8^d) +3*x^(3*8^d) +4*x^(4*8^d) +5*x^(5*8^d) +6*x^(6*8^d) +7*x^(7*8^d)) * (1-x^(8^d)) / ((1-x^(8^(d+1)))*(1-x))). - Robert Israel, Aug 03 2014

A052382 Numbers without 0 in the decimal expansion, colloquial 'zeroless numbers'.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 111, 112, 113
Offset: 1

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

Comments

The entries 1 to 79 match the corresponding subsequence of A043095, but then 81, 91-98, 100, 102, etc. are only in one of the two sequences. - R. J. Mathar, Oct 13 2008
Complement of A011540; A168046(a(n)) = 1; A054054(a(n)) > 0; A007602, A038186, A038618, A052041, A052043, and A052045 are subsequences. - Reinhard Zumkeller, Apr 25 2012, Apr 07 2011, Dec 01 2009
a(n) = n written in base 9 where zeros are not allowed but nines are. The nine distinct digits used are 1, 2, 3, ..., 9 instead of 0, 1, 2, ..., 8. To obtain this sequence from the "canonical" base 9 sequence with zeros allowed, just replace any 0 with a 9 and then subtract one from the group of digits situated on the left. For example, 9^3 = 729 (10) (in base 10) = 1000 (9) (in base 9) = 889 (9-{0}) (in base 9 without zeros) because 100 (9) = [9-1]9 = 89 (9-{0}) and thus 1000 (9) = [89-1]9 = 889 (9-{0}). - Robin Garcia, Jan 15 2014
From Hieronymus Fischer, May 28 2014: (Start)
Inversion: Given a term m, the index n such that a(n) = m can be calculated by A052382_inverse(m) = m - sum_{1<=j<=k} floor(m/10^j)*9^(j-1), where k := floor(log_10(m)) [see Prog section for an implementation in Smalltalk].
Example 1: A052382_inverse(137) = 137 - (floor(137/10) + floor(137/100)*9) = 137 - (13*1 + 1*9) = 137 - 22 = 115.
Example 2: A052382_inverse(4321) = 4321 - (floor(4321/10) + floor(4321/100)*9 + floor(4321/1000)*81) = 4321 - (432*1 + 43*9 + 4*81) = 4321 - (432 + 387 + 324) = 3178. (End)
The sum of the reciprocals of these numbers from a(1)=1 to infinity, called the Kempner series, is convergent towards a limit: 23.103447... whose decimal expansion is in A082839. - Bernard Schott, Feb 23 2019
Integer n > 0 is encoded using bijective base-9 numeration, see Wikipedia link below. - Alois P. Heinz, Feb 16 2020

Examples

			For k >= 0, a(10^k) = (1, 11, 121, 1331, 14641, 162151, 1783661, 19731371, ...) = A325203(k). - _Hieronymus Fischer_, May 30 2012 and Jun 06 2012; edited by _M. F. Hasler_, Jan 13 2020
		

References

  • Paul Halmos, "Problems for Mathematicians, Young and Old", Dolciani Mathematical Expositions, 1991, p. 258.

Crossrefs

Cf. A004719, A052040, different from A067251.
Column k=9 of A214676.
Cf. A011540 (complement), A043489, A054054, A168046.
Cf. A052383 (without 1), A052404 (without 2), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052419 (without 7), A052421 (without 8), A007095 (without 9).
Zeroless numbers in some other bases <= 10: A000042 (base 2), A032924 (base 3), A023705 (base 4), A248910 (base 6), A255805 (base 8), A255808 (base 9).
Cf. A082839 (sum of reciprocals).
Cf. A038618 (subset of primes)

Programs

  • Haskell
    a052382 n = a052382_list !! (n-1)
    a052382_list = iterate f 1 where
    f x = 1 + if r < 9 then x else 10 * f x' where (x', r) = divMod x 10
    -- Reinhard Zumkeller, Mar 08 2015, Apr 07 2011
    
  • Magma
    [ n: n in [1..114] | not 0 in Intseq(n) ]; // Bruno Berselli, May 28 2011
    
  • Maple
    a:= proc(n) local d, l, m; m:= n; l:= NULL;
          while m>0 do d:= irem(m, 9, 'm');
            if d=0 then d:=9; m:= m-1 fi;
            l:= d, l
          od; parse(cat(l))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 11 2015
    is_zeroless := n -> not is(0 in convert(n, base, 10)):
    select(is_zeroless, [seq(1..113)]);  # Peter Luschny, Jun 20 2025
  • Mathematica
    A052382 = Select[Range[100], DigitCount[#, 10, 0] == 0 &] (* Alonso del Arte, Mar 10 2011 *)
  • PARI
    select( {is_A052382(n)=n&&vecmin(digits(n))}, [0..111]) \\ actually: is_A052382 = (bool) A054054. - M. F. Hasler, Jan 23 2013, edited Jan 13 2020
    
  • PARI
    a(n) = for (w=0, oo, if (n >= 9^w, n -= 9^w, return ((10^w-1)/9 + fromdigits(digits(n, 9))))) \\ Rémy Sigrist, Jul 26 2017
    
  • PARI
    apply( {A052382(n,L=logint(n,9))=fromdigits(digits(n-9^L>>3,9))+10^L\9}, [1..100])
    next_A052382(n, d=digits(n+=1))={for(i=1, #d, d[i]|| return(n-n%(d=10^(#d-i+1))+d\9)); n} \\ least a(k) > n. Used in A038618.
    ( {A052382_vec(n,M=1)=M--;vector(n, i, M=next_A052382(M))} )(99) \\ n terms >= M
    \\ See OEIS Wiki page (cf. LINKS) for more programs. - M. F. Hasler, Jan 11 2020
    
  • Python
    A052382 = [n for n in range(1,10**5) if not str(n).count('0')]
    # Chai Wah Wu, Aug 26 2014
    
  • Python
    from sympy import integer_log
    def A052382(n):
        m = integer_log(k:=(n<<3)+1,9)[0]
        return sum((1+(k-9**m)//(9**j<<3)%9)*10**j for j in range(m)) # Chai Wah Wu, Jun 27 2025
  • Smalltalk
    A052382
    "Answers the n-th term of A052382, where n is the receiver."
    ^self zerofree: 10
    A052382_inverse
    "Answers that index n which satisfy A052382(n) = m, where m is the receiver.”
    ^self zerofree_inverse: 10
    zerofree: base
    "Answers the n-th zerofree number in base base, where n is the receiver. Valid for base > 2.
    Usage: n zerofree: b [b = 10 for this sequence]
    Answer: a(n)"
    | n m s c bi ci d |
    n := self.
    c := base - 1.
    m := (base - 2) * n + 1 integerFloorLog: c.
    d := n - (((c raisedToInteger: m) - 1)//(base - 2)).
    bi := 1.
    ci := 1.
    s := 0.
    1 to: m
    do:
    [:i |
    s := (d // ci \\ c + 1) * bi + s.
    bi := base * bi.
    ci := c * ci].
    ^s
    zerofree_inverse: base
    "Answers the index n such that the n-th zerofree number in base base is = m, where m is the receiver. Valid for base > 2.
    Usage: m zerofree_inverse: b [b = 10 for this sequence]
    Answer: n"
    | m p q s |
    m := self.
    s := 0.
    p := base.
    q := 1.
    [p < m] whileTrue:
    [s := m // p * q + s.
    p := base * p.
    q := (base - 1) * q].
    ^m - s
    "by Hieronymus Fischer, May 28 2014"
    
  • sh
    seq 0 1000 | grep -v 0; # Joerg Arndt, May 29 2011
    

Formula

a(n+1) = f(a(n)) with f(x) = 1 + if x mod 10 < 9 then x else 10*f([x/10]). - Reinhard Zumkeller, Nov 15 2009
From Hieronymus Fischer, Apr 30, May 30, Jun 08 2012, Feb 17 2019: (Start)
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 9)*10^j, where m = floor(log_9(8*n + 1)), b(j) = floor((8*n + 1 - 9^m)/(8*9^j)).
Also: a(n) = Sum_{j=0..m-1} (1 + A010878(b(j)))*10^j.
a(9*n + k) = 10*a(n) + k, k=1..9.
Special values:
a(k*(9^n - 1)/8) = k*(10^n - 1)/9, k=1..9.
a((17*9^n - 9)/8) = 2*10^n - 1.
a((9^n - 1)/8 - 1) = 10^(n-1) - 1, n > 1.
Inequalities:
a(n) <= (1/9)*((8*n+1)^(1/log_10(9)) - 1), equality holds for n=(9^k-1)/8, k>0.
a(n) > (1/10)*((8*n+1)^(1/log_10(9)) - 1), n > 0.
Lower and upper limits:
lim inf a(n)/10^log_9(8*n) = 1/10, for n -> infinity.
lim inf a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/10, for n -> infinity.
lim sup a(n)/10^log_9(8*n) = 1/9, for n -> infinity.
lim sup a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/9, for n -> infinity.
G.f.: g(x) = (x^(1/8)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(9/8)*(1 - 10z(j)^9 + 9z(j)^10)/((1-z(j))(1-z(j)^9)), where z(j) = x^9^j.
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1 - 10(x^9^j)^9 + 9(x^9^j)^10)*x^9^j*f_j(x)/(1-x^9^j), where f_j(x) = 10^j*x^((9^j-1)/8)/(1-(x^9^j)^9). Here, the f_j obey the recurrence f_0(x) = 1/(1-x^9), f_(j+1)(x) = 10x*f_j(x^9).
Also: g(x) = (1/(1-x))*((Sum{k=0..8} h_(9,k)(x)) - 9*h_(9,9)(x)), where h_(9,k)(x) = Sum_{j>=0} 10^j*x^((9^(j+1)-1)/8)*x^(k*9^j)/(1-x^9^(j+1)).
Generic formulas for analogous sequences with numbers expressed in base p and only using the digits 1, 2, 3, ... d, where 1 < d < p:
a(n) = Sum_{j=0..m-1} (1 + b(j) mod d)*p^j, where m = floor(log_d((d-1)*n+1)), b(j) = floor(((d-1)*n+1-d^m)/((d-1)*d^j)).
Special values:
a(k*(d^n-1)/(d-1)) = k*(10^n-1)/9, k=1..d.
a(d*((2d-1)*d^(n-1)-1)/(d-1)) = ((d+9)*10^n-d)/9 = 10^n + d*(10^n-1)/9.
a((d^n-1)/(d-1)-1) = d*(10^(n-1)-1)/9, n > 1.
Inequalities:
a(n) <= (10^log_d((d-1)*n+1)-1)/9, equality holds for n = (d^k-1)/(d-1), k > 0.
a(n) > (d/10)*(10^log_d((d-1)*n+1)-1)/9, n > 0.
Lower and upper limits:
lim inf a(n)/10^log_d((d-1)*n) = d/90, for n -> infinity.
lim sup a(n)/10^log_d((d-1)*n) = 1/9, for n -> infinity.
G.f.: g(x) = (1/(1-x)) Sum_{j>=0} (1 - (d+1)(x^d^j)^d + d(x^d^j)^(d+1))*x^d^j*f_j(x)/(1-x^d^j), where f_j(x) = p^j*x^((d^j-1)/(d-1))/(1-(x^d^j)^d). Here, the f_j obey the recursion f_0(x) = 1/(1-x^d), f_(j+1)(x) = px*f_j(x^d).
(End)
A052382 = { n | A054054(n) > 0 }. - M. F. Hasler, Jan 23 2013
From Hieronymus Fischer, Feb 20 2019: (Start)
Sum_{n>=1} (-1)^(n+1)/a(n) = 0.696899720...
Sum_{n>=1} 1/a(n)^2 = 1.6269683705819...
Sum_{n>=1} 1/a(n) = 23.1034479... = A082839. This so-called Kempner series converges very slowly. For the calculation of the sum, it is helpful to use the following fraction of partial sums, which converges rapidly:
lim_{n->infinity} (Sum_{k=p(n)..p(n+1)-1} 1/a(k)) / (Sum_{k=p(n-1)..p(n)-1} 1/a(k)) = 9/10, where p(n) = (9^n-1)/8, n > 1.
(End)

Extensions

Typos in formula section corrected by Hieronymus Fischer, May 30 2012
Name clarified by Peter Luschny, Jun 20 2025

A007093 Numbers in base 7.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 30, 31, 32, 33, 34, 35, 36, 40, 41, 42, 43, 44, 45, 46, 50, 51, 52, 53, 54, 55, 56, 60, 61, 62, 63, 64, 65, 66, 100, 101, 102, 103, 104, 105, 106, 110, 111, 112, 113, 114, 115, 116, 120
Offset: 0

Views

Author

Keywords

References

  • Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See p. 67.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    A007093 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,7): return op(convert(l,base,10,10^nops(l))): end: seq(A007093(n),n=0..63); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 7]], {n, 0, 66}]
  • PARI
    a(n)=if(n<1,0,if(n%7,a(n-1)+1,10*a(n/7)))
    
  • PARI
    a(n) = fromdigits(digits(n, 7)); \\ Michel Marcus, Aug 12 2018

Formula

a(0) = 0, a(n) = 10*a(n/7) if n==0 (mod 7), a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002

A007092 Numbers in base 6.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 25, 30, 31, 32, 33, 34, 35, 40, 41, 42, 43, 44, 45, 50, 51, 52, 53, 54, 55, 100, 101, 102, 103, 104, 105, 110, 111, 112, 113, 114, 115, 120, 121, 122, 123, 124, 125, 130, 131, 132, 133, 134, 135, 140, 141, 142, 143, 144, 145
Offset: 0

Views

Author

Keywords

Comments

Nonnegative integers with no decimal digits > 5. - Karol Bacik, Sep 25 2012

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000042 (base 1), A007088 (base 2), A007089 (base 3), A007090 (base 4), A007091 (base 5), A007093 (base 7), A007094 (base 8), A007095 (base 9).

Programs

  • Haskell
    a007092 0 = 0
    a007092 n = 10 * a007092 n' + m where (n', m) = divMod n 6
    -- Reinhard Zumkeller, Mar 06 2015
  • Maple
    A007092 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,6): return op(convert(l,base,10,10^nops(l))): end: seq(A007092(n),n=0..59); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 6]], {n, 0, 65}]
  • PARI
    a(n)=if(n%6,a(n-1)+1,if(n,10*a(n/6),0))  \\ corrected by Charles R Greathouse IV, Sep 25 2012
    
  • PARI
    a(n)=n=digits(n,6);n[1]=Str(n[1]);eval(concat(n)) \\ Charles R Greathouse IV, Sep 25 2012
    
  • PARI
    apply( A007092(n)=fromdigits(digits(n, 6)), [0..66]) \\ M. F. Hasler, Nov 18 2019
    

Formula

a(0)=0, a(n) = 10*a(n/6) if n==0 (mod 6), and a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002
a(n) = Sum{d(i)*10^i: i=0,1,...,m}, where Sum{d(i)*6^i: i=1,2,...,m} = n, and d(i) in {0,1,...,5}. - Karol Bacik, Sep 25 2012

A000042 Unary representation of natural numbers.

Original entry on oeis.org

1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 1111111111, 11111111111, 111111111111, 1111111111111, 11111111111111, 111111111111111, 1111111111111111, 11111111111111111, 111111111111111111, 1111111111111111111, 11111111111111111111
Offset: 1

Views

Author

Keywords

Comments

Or, numbers written in base 1.
If p is a prime > 5 then d_{a(p)} == 1 (mod p) where d_{a(p)} is a divisor of a(p). This also gives an alternate elementary proof of the infinitude of prime numbers by the fact that for every prime p there exists at least one prime of the form k*p + 1. - Amarnath Murthy, Oct 05 2002
11 = 1*9 + 2; 111 = 12*9 + 3; 1111 = 123*9 + 4; 11111 = 1234*9 + 5; 111111 = 12345*9 + 6; 1111111 = 123456*9 + 7; 11111111 = 1234567*9 + 8; 111111111 = 12345678*9 + 9. - Vincenzo Librandi, Jul 18 2010

References

  • Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See pp. 57-58.
  • K. G. Kroeber, Mathematik der Palindrome; p. 348; 2003; ISBN 3 499 615762; Rowohlt Verlag; Germany.
  • D. Olivastro, Ancient Puzzles. Bantam Books, NY, 1993, p. 276.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 32.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    A000042 n = (10^n-1) `div` 9 -- James Spahlinger, Oct 08 2012
    (Common Lisp) (defun a000042 (n) (truncate (expt 10 n) 9)) ; James Spahlinger, Oct 12 2012
    
  • Magma
    [(10^n - 1)/9: n in [1..20]]; // G. C. Greubel, Nov 04 2018
    
  • Maple
    a:= n-> parse(cat(1$n)):
    seq(a(n), n=1..25);  # Alois P. Heinz, Mar 23 2018
  • Mathematica
    Table[(10^n - 1)/9, {n, 1, 18}]
    FromDigits/@Table[PadLeft[{},n,1],{n,20}] (* Harvey P. Dale, Aug 21 2011 *)
  • PARI
    a(n)=if(n<0,0,(10^n-1)/9)
    
  • Python
    def a(n): return int("1"*n) # Michael S. Branicky, Jan 01 2021
  • Sage
    [gaussian_binomial(n, 1, 10) for n in range(1, 19)]  # Zerinvary Lajos, May 28 2009
    

Formula

a(n) = (10^n - 1)/9.
G.f.: 1/((1-x)*(1-10*x)).
Binomial transform of A003952. - Paul Barry, Jan 29 2004
From Paul Barry, Aug 24 2004: (Start)
a(n) = 10*a(n-1) + 1, n > 1, a(1)=1. [Offset 1.]
a(n) = Sum_{k=0..n} binomial(n+1, k+1)*9^k. [Offset 0.] (End)
a(2n) - 2*a(n) = (3*a(n))^2. - Amarnath Murthy, Jul 21 2003
a(n) is the binary representation of the n-th Mersenne number (A000225). - Ross La Haye, Sep 13 2003
The Hankel transform of this sequence is [1,-10,0,0,0,0,0,0,0,0,...]. - Philippe Deléham, Nov 21 2007
E.g.f.: (exp(10*x) - exp(x))/9. - G. C. Greubel, Nov 04 2018
a(n) = 11*a(n-1) - 10*a(n-2). - Wesley Ivan Hurt, May 28 2021
a(n+m-2) = a(m)*a(n-1) - (a(m)-1)*a(n-2), n>1, m>0. - Matej Veselovac, Jun 07 2021
Sum_{n>=1} 1/a(n) = A065444. - Stefano Spezia, Jul 30 2024

Extensions

More terms from Paul Barry, Jan 29 2004

A011539 "9ish numbers": decimal representation contains at least one nine.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The 9ish numbers are closed under lunar multiplication. The lunar primes (A087097) are a subset.
Almost all numbers are 9ish, in the sense that the asymptotic density of this set is 1: Among the 9*10^(n-1) n-digit numbers, only a fraction of 0.8*0.9^(n-1) doesn't have a digit 9, and this fraction tends to zero (< 1/10^k for n > 22k-3). This explains the formula a(n) ~ n. - M. F. Hasler, Nov 19 2018
A 9ish number is a number whose largest decimal digit is 9. - Stefano Spezia, Nov 16 2023

Examples

			E.g. 9, 19, 69, 90, 96, 99 and 1234567890 are all 9ish.
		

Crossrefs

Cf. A088924 (number of n-digit terms).
Cf. A087062 (lunar product), A087097 (lunar primes).
A102683 (number of digits 9 in n); fixed points > 8 of A068505.
Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), A337250 (b=4), A337572 (b=5), A333656 (b=6), A337141 (b=7), A337239 (b=8), A338090 (b=9), this sequence (b=10), A095778 (b=11).
Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).
Supersequence of A043525.

Programs

  • GAP
    Filtered([1..300],n->9 in ListOfDigits(n)); # Muniru A Asiru, Feb 25 2019
    
  • Haskell
    a011539 n = a011539_list !! (n-1)
    a011539_list = filter ((> 0) . a102683) [1..]  -- Reinhard Zumkeller, Dec 29 2011
    
  • Maple
    seq(`if`(numboccur(9, convert(n, base, 10))>0, n, NULL), n=0..100); # François Marques, Oct 12 2020
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 10 ], 9 ]>0)& ] (* François Marques, Oct 12 2020 *)
    Select[Range[300],DigitCount[#,10,9]>0&] (* Harvey P. Dale, Mar 04 2023 *)
  • PARI
    is(n)=n=vecsort(digits(n));n[#n]==9 \\ Charles R Greathouse IV, May 15 2013
    
  • PARI
    select( is_A011539(n)=vecmax(digits(n))==9, [1..300]) \\ M. F. Hasler, Nov 16 2018
    
  • Python
    def ok(n): return '9' in str(n)
    print(list(filter(ok, range(299)))) # Michael S. Branicky, Sep 19 2021
    
  • Python
    def A011539(n):
        def f(x):
            l = (s:=str(x)).find('9')
            if l >= 0: s = s[:l]+'8'*(len(s)-l)
            return n+int(s,9)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Dec 04 2024

Formula

Complement of A007095. A102683(a(n)) > 0 (defines this sequence). A068505(a(n)) = a(n): fixed points of A068505 are the terms of this sequence and the numbers < 9. - Reinhard Zumkeller, Dec 29 2011, edited by M. F. Hasler, Nov 16 2018
a(n) ~ n. - Charles R Greathouse IV, May 15 2013
Showing 1-10 of 310 results. Next