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

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

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

A007095 Numbers in base 9.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84
Offset: 0

Views

Author

Keywords

Comments

Also numbers without 9 as a digit.
Complement of A011539: A102683(a(n)) = 0; A068505(a(n)) != a(n)). - Reinhard Zumkeller, Dec 29 2011

References

  • Julian Havil, Gamma, Exploring Euler's Constant, Princeton University Press, Princeton and Oxford, 2003, page 34.
  • 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), A007092 (base 6), A007093 (base 7), A007094 (base 8); A057104, A037479.
Cf. A052382 (without 0), A052383 (without 1), A052404 (without 2), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052419 (without 7), A052421 (without 8).
Cf. A082838.

Programs

  • Haskell
    a007095 = f . subtract 1 where
       f 0 = 0
       f v = 10 * f w + r   where (w, r) = divMod v 9
    -- Reinhard Zumkeller, Oct 07 2014, Dec 29 2011
    
  • Magma
    [ n: n in [0..74] | not 9 in Intseq(n) ];  // Bruno Berselli, May 28 2011
    
  • Maple
    A007095 := proc(n) local l: if(n=0)then return 0: fi: l:=convert(n,base,9): return op(convert(l,base,10,10^nops(l))): end: seq(A007095(n),n=0..67); # Nathaniel Johnston, May 06 2011
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 9]], {n, 0, 75}]
  • PARI
    a(n)=if(n<1,0,if(n%9,a(n-1)+1,10*a(n/9)))
    
  • PARI
    A007095(n)=fromdigits(digits(n, 9)) \\ Michel Marcus, Dec 29 2018
    
  • Python
    # and others: see OEIS Wiki page (cf. LINKS).
    
  • Python
    from gmpy2 import digits
    def A007095(n): return int(digits(n,9)) # Chai Wah Wu, May 06 2025
  • sh
    seq 0 1000 | grep -v 9; # Joerg Arndt, May 29 2011
    

Formula

a(0) = 0, a(n) = 10*a(n/9) if n==0 (mod 9), a(n) = a(n-1)+1 otherwise. - Benoit Cloitre, Dec 22 2002
Sum_{n>1} 1/a(n) = A082838 = 22.92067... (Kempner series). - Bernard Schott, Dec 29 2018; edited by M. F. Hasler, Jan 13 2020

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

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

A053737 Sum of digits of (n written in base 4).

Original entry on oeis.org

0, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 6, 7, 8, 9, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6, 7, 5, 6, 7, 8, 3, 4, 5, 6, 4, 5, 6, 7, 5
Offset: 0

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

Also the fixed point of the morphism 0->{0,1,2,3}, 1->{1,2,3,4}, 2->{2,3,4,5}, etc. - Robert G. Wilson v, Jul 27 2006

Examples

			a(20) = 1+1+0 = 2 because 20 is written as 110 base 4.
From _Omar E. Pol_, Feb 21 2010: (Start)
This can be written as a triangle (cf. A000120):
  0,
  1,2,3,
  1,2,3,4,2,3,4,5,3,4,5,6,
  1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8,3,4,5,6,4,5,6,7,5,6,7,8,6,7,8,9,
  1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8,3,4,5,6,4,...
where the rows converge to A173524.
(End)
		

Crossrefs

Cf. A173524. - Omar E. Pol, Feb 21 2010
Sum of digits of n written in bases 2-16: A000120, A053735, this sequence, A053824, A053827, A053828, A053829, A053830, A007953, A053831, A053832, A053833, A053834, A053835, A053836.
Related base-4 sequences: A053737, A230631, A230632, A010064, A230633, A230634, A230635, A230636, A230637, A230638, A010065 (trajectory of 1).

Programs

  • Haskell
    a053737 n = if n == 0 then 0 else a053737 m + r where (m, r) = divMod n 4
    -- Reinhard Zumkeller, Mar 19 2015
    
  • MATLAB
    for u=0:104; sol(u+1)=sum(dec2base(u,4)-'0');end
    sol % Marius A. Burtea, Jan 17 2019
  • Magma
    [&+Intseq(n,4):n in [0..104]]; // Marius A. Burtea, Jan 17 2019
    
  • Maple
    A053737 := proc(n)
        add(d,d=convert(n,base,4)) ;
    end proc: # R. J. Mathar, Oct 31 2012
  • Mathematica
    Table[Plus @@ IntegerDigits[n, 4], {n, 0, 100}] (* or *)
    Nest[ Flatten[ #1 /. a_Integer -> {a, a+1, a+2, a+3}] &, {0}, 4] (* Robert G. Wilson v, Jul 27 2006 *)
    DigitSum[Range[0, 100], 4] (* Paolo Xausa, Aug 01 2024 *)
  • PARI
    a(n)=if(n<1,0,if(n%4,a(n-1)+1,a(n/4)))
    
  • PARI
    a(n) = sumdigits(n, 4); \\ Michel Marcus, Aug 24 2019
    

Formula

From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(4n+i) = a(n)+i for 0 <= i <= 3.
a(n) = n - 3*Sum_{k>0} floor(n/4^k) = n - 3*A054893(n). (End)
G.f.: (Sum_{k>=0} (x^(4^k) + 2*x^(2*4^k) + 3*x^(3*4^k))/(1 + x^(4^k) + x^(2*4^k) + x^(3*4^k)))/(1-x). - Franklin T. Adams-Watters, Nov 03 2005
a(n) = A138530(n,4) for n > 3. - Reinhard Zumkeller, Mar 26 2008
a(n) = Sum_{k>=0} A030386(n,k). - Philippe Deléham, Oct 21 2011
a(n) = A007953(A007090(n)). - Reinhard Zumkeller, Mar 19 2015
a(0) = 0; a(n) = a(n - 4^floor(log_4(n))) + 1. - Ilya Gutkovskiy, Aug 23 2019
Sum_{n>=1} a(n)/(n*(n+1)) = 4*log(4)/3 (Shallit, 1984). - Amiram Eldar, Jun 03 2021

A014418 Representation of n in base of Catalan numbers (a classic greedy version).

Original entry on oeis.org

0, 1, 10, 11, 20, 100, 101, 110, 111, 120, 200, 201, 210, 211, 1000, 1001, 1010, 1011, 1020, 1100, 1101, 1110, 1111, 1120, 1200, 1201, 1210, 1211, 2000, 2001, 2010, 2011, 2020, 2100, 2101, 2110, 2111, 2120, 2200, 2201, 2210, 2211, 10000
Offset: 0

Views

Author

Keywords

Comments

From Antti Karttunen, Jun 22 2014: (Start)
Also called "Greedy Catalan Base" for short.
Note: unlike A239903, this is a true base system, thus A244158(a(n)) = n holds for all n. See also A244159 for another, "less greedy" Catalan Base number system.
No digits larger than 3 will ever appear, because C(n+1)/C(n) approaches 4 from below, but never reaches it. [Where C(n) is the n-th Catalan number, A000108(n)].
3-digits cannot appear earlier than at the fifth digit-position from the right, the first example being a(126) = 30000.
The last digit is always either 0 or 1. (Cf. the sequences A244222 and A244223 which give the corresponding k for "even" and "odd" representations). No term ends as ...21.
No two "odd" terms (ending with 1) may occur consecutively.
A244217 gives the k for which a(k) starts with the digit 1, while A244216 gives the k for which a(k) starts with the digit 2 or 3.
A000108(n+1) gives the position of numeral where 1 is followed by n zeros.
A014138 gives the positions of repunits.
A197433 gives such k that a(k) = A239903(k). [Actually, such k, that the underlying strings of digits/numbers are same].
For the explanations, see the attached notes.
(End)

Examples

			A simple weighted sum of Sum_{k} digit(k)*C(k) [where C(k) = A000108(k), and digit(1) is the rightmost digit] recovers the natural number n (which the given numeral a(n) represents) as follows:
a(11) = 201, and indeed 2*C(3) + 0*C(2) + 1*C(1) = 2*5 + 0*2 + 1*1 = 11.
a(126) = 30000, and indeed, 3*C(5) = 3*42 = 126.
		

Crossrefs

Cf. A014420 (gives the sum of digits), A244221 (same sequence reduced modulo 2, or equally, the last digit of a(n)), A244216, A244217, A244222, A244223, A000108, A007623, A197433, A239903, A244155, A244158, A244320, A244318, A244159 (a variant), A244161 (in base-4), A014417 (analogous sequence for Fibonacci numbers).

Programs

  • Mathematica
    CatalanBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > CatalanNumber[i], i++]; m = n; len = i; dList = Table[0, {len}]; Do[currDigit = 0; While[m >= CatalanNumber[j], m = m - CatalanNumber[j]; currDigit++]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; FromDigits@ dList]; Array [CatalanBaseIntDs, 50, 0] (* Robert G. Wilson v, Jul 02 2014 *)
  • Python
    from sympy import catalan
    def a244160(n):
        if n==0: return 0
        i=1
        while True:
            if catalan(i)>n: break
            else: i+=1
        return i - 1
    def a(n):
        if n==0: return 0
        x=a244160(n)
        return 10**(x - 1) + a(n - catalan(x))
    print([a(n) for n in range(51)]) # Indranil Ghosh, Jun 08 2017

Formula

From Antti Karttunen, Jun 23 2014: (Start)
a(0) = 0, a(n) = 10^(A244160(n)-1) + a(n-A000108(A244160(n))). [Here A244160 gives the index of the largest Catalan number that still fits into the sum].
a(n) = A007090(A244161(n)).
For all n, A000035(a(n)) = A000035(A244161(n)) = A244221(n).
(End)

Extensions

Description clarified by Antti Karttunen, Jun 22 2014

A030373 Write n in base 4 and juxtapose.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

An irregular table in which the n-th row lists the base-4 digits of n. - Jason Kimberley, Nov 26 2012
The base-4 Champernowne constant: it is normal in base 4. - Jason Kimberley, Nov 26 2012

Examples

			1;
2;
3;
1,0;
1,1;
1,2;
1,3;
2,0;
2,1;
2,2;
...
3,3;
1,0,0;
1,0,1;
1,0,2;
1,0,3;
1,1,0; ....
		

Crossrefs

Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b=2), A003137 and A054635 (b=3), this sequence (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012

Programs

  • Magma
    &cat[Reverse(IntegerToSequence(n,4)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten[IntegerDigits[Range[40],4]] (* Harvey P. Dale, Aug 23 2011 *)
  • Python
    from itertools import count, chain, islice
    from sympy.ntheory.factor_ import digits
    def A030373_gen(): return chain.from_iterable(digits(m, 4)[1:] for m in count(1))
    A030373_list = list(islice(A030373_gen(), 30)) # Chai Wah Wu, Jan 07 2022
Showing 1-10 of 321 results. Next