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-7 of 7 results.

A004760 List of numbers whose binary expansion does not begin 10.

Original entry on oeis.org

0, 1, 3, 6, 7, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
Offset: 1

Views

Author

Keywords

Comments

For n >= 2 sequence {a(n+2)} is the minimal recursive such that A007814(a(n+2))=A007814(n). - Vladimir Shevelev, Apr 27 2009
A053645(a(n)) = n-1 for n > 0. - Reinhard Zumkeller, May 20 2009
a(n+1) is also the number of nodes in a complete binary tree with n nodes in the bottommost level. - Jacob Jona Fahlenkamp, Feb 01 2023

Crossrefs

Programs

  • Maple
    0,1,seq(seq(3*2^d+x,x=0..2^d-1),d=0..6); # Robert Israel, Aug 03 2016
  • Mathematica
    Select[Range@ 125, If[Length@ # < 2, #, Take[#, 2]] &@ IntegerDigits[#, 2] != {1, 0} &] (* Michael De Vlieger, Aug 02 2016 *)
  • PARI
    is(n)=n<2 || binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    print1("0, 1");for(i=0,5,for(n=3<Charles R Greathouse IV, Sep 23 2012
    
  • PARI
    a(n) = if(n<=2,n-1, (n-=2) + 2<Kevin Ryde, Jul 22 2022
    
  • Python
    def A004760(n): return m+(1<0 else n-1 # Chai Wah Wu, Jul 26 2023
  • R
    maxrow <- 8 # by choice
    b01 <- 1
    for(m in 0:maxrow){
      b01 <- c(b01,rep(1,2^(m+1))); b01[2^(m+1):(2^(m+1)+2^m-1)] <- 0
    }
    a <- which(b01 == 1)
    # Yosu Yurramendi, Mar 30 2017
    

Formula

For n > 0, a(n) = 3n - 2 - A006257(n-1). - Ralf Stephan, Sep 16 2003
a(0) = 0, a(1) = 1, for n > 0: a(2n) = 2*a(n) + 1, a(2n+1) = 2*a(n+1). - Philippe Deléham, Feb 29 2004
For n >= 3, A007814(a(n)) = A007814(n-2). - Vladimir Shevelev, Apr 15 2009
a(n+2) = min{m>a(n+1): A007814(m)=A007814(n)}; A010060(a(n+2)) = 1-A010060(n). - Vladimir Shevelev, Apr 27 2009
a(1)=0, a(2)=1, a(2^m+k+2) = 2^(m+1) + 2^m+k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Jul 30 2016
G.f.: x/(1-x)^2 + (x/(1-x))*Sum_{k>=0} 2^k*x^(2^k). - Robert Israel, Aug 03 2016
a(2^m+k) = A004761(2^m+k) + 2^m, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016
For n > 0, a(n+1) = n + 2^ceiling(log_2(n)) - 1. - Jacob Jona Fahlenkamp, Feb 01 2023

Extensions

Offset changed to 1, b-file corrected. - N. J. A. Sloane, Aug 07 2016

A004754 Numbers n whose binary expansion starts 10.

Original entry on oeis.org

2, 4, 5, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 128, 129, 130, 131
Offset: 1

Views

Author

Keywords

Comments

A000120(a(n)) = A000120(n); A023416(a(n-1)) = A008687(n) for n > 1. - Reinhard Zumkeller, Dec 04 2015

Examples

			10 in binary is 1010, so 10 is in sequence.
		

Crossrefs

Cf. A123001 (binary version), A004755 (11), A004756 (100), A004757 (101), A004758 (110), A004759 (111).
Apart from initial terms, same as A004761.

Programs

  • Haskell
    import Data.List (transpose)
    a004754 n = a004754_list !! (n-1)
    a004754_list = 2 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004754_list
    -- Reinhard Zumkeller, Dec 04 2015
    
  • Mathematica
    w = {1, 0}; Select[Range[2, 131], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 08 2016 *)
  • PARI
    a(n)=n+2^floor(log(n)/log(2))
    
  • PARI
    is(n)=n>1 && !binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
    
  • Python
    def A004754(n): return n+(1<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + [n==0].
a(n) = n + 2^floor(log_2(n)) = n + A053644(n).
a(2^m+k) = 2^(m+1) + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A004755 Binary expansion starts 11.

Original entry on oeis.org

3, 6, 7, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122
Offset: 1

Views

Author

Keywords

Comments

a(n) is the smallest value > a(n-1) (or > 1 for n=1) for which A001511(a(n)) = A001511(n). - Franklin T. Adams-Watters, Oct 23 2006

Examples

			12 in binary is 1100, so 12 is in the sequence.
		

Crossrefs

Equals union of A079946 and A080565.
Cf. A004754 (10), A004756 (100), A004757 (101), A004758 (110), A004759 (111).

Programs

  • Haskell
    import Data.List (transpose)
    a004755 n = a004755_list !! (n-1)
    a004755_list = 3 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004755_list
    -- Reinhard Zumkeller, Dec 04 2015
    
  • Maple
    a:= proc(n) n+2*2^floor(log(n)/log(2)) end: seq(a(n),n=1..60); # Muniru A Asiru, Oct 16 2018
  • Mathematica
    Flatten[Table[FromDigits[#,2]&/@(Join[{1,1},#]&/@Tuples[{0,1},n]),{n,0,5}]] (* Harvey P. Dale, Feb 05 2015 *)
  • PARI
    a(n)=n+2*2^floor(log(n)/log(2))
    
  • PARI
    is(n)=n>2 && binary(n)[2] \\ Charles R Greathouse IV, Sep 23 2012
    
  • Python
    f = open('b004755.txt', 'w')
    lo = 3
    hi = 4
    i = 1
    while i<16384:
        for x in range(lo,hi):
            f.write(str(i)+" "+str(x)+"\n")
            i += 1
        lo <<= 1
        hi <<= 1
    # Kenny Lau, Jul 05 2016
    
  • Python
    def A004755(n): return n+(1<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2*a(n), a(2n+1) = 2*a(n) + 1 + 2*[n==0].
a(n) = n + 2 * 2^floor(log_2(n)) = A004754(n) + A053644(n).
a(n) = 2n + A080079(n). - Benoit Cloitre, Feb 22 2003
G.f.: (1/(1+x)) * (1 + Sum_{k>=0, t=x^2^k} 2^k*(2t+t^2)/(1+t)).
a(n) = n + 2^(floor(log_2(n)) + 1) = n + A062383(n). - Franklin T. Adams-Watters, Oct 23 2006
a(2^m+k) = 2^(m+1) + 2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A004757 Binary expansion starts 101.

Original entry on oeis.org

5, 10, 11, 20, 21, 22, 23, 40, 41, 42, 43, 44, 45, 46, 47, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185
Offset: 1

Views

Author

Keywords

Examples

			22 in binary is 10110, so 22 is in sequence.
		

Crossrefs

Cf. A004754 (10), A004755 (11), A004756 (100), A004758 (110), A004759 (111).

Programs

  • Haskell
    import Data.List (transpose)
    a004757 n = a004757_list !! (n-1)
    a004757_list = 5 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004757_list
    -- Reinhard Zumkeller, Dec 04 2015
    
  • Mathematica
    Table[n + 4*2^Floor@ Log2@ n, {n, 57}] (* or *)
    w = {1, 0, 1}; Select[Range[5, 185], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 10 2016 *)
    Select[Range[5,200],Take[IntegerDigits[#,2],3]=={1,0,1}&] (* Harvey P. Dale, Aug 26 2016 *)
  • PARI
    a(n)=n+4*2^floor(log(n)/log(2))
    
  • Python
    def A004757(n): return n+(2<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 4*[n==0].
a(n) = n + 4 * 2^floor(log_2(n)) = A004756(n) + A053644(n).
a(2^m+k) = 5*2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A004758 Binary expansion starts 110.

Original entry on oeis.org

6, 12, 13, 24, 25, 26, 27, 48, 49, 50, 51, 52, 53, 54, 55, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213
Offset: 1

Views

Author

Keywords

Examples

			26 in binary is 11010, so 26 is in sequence.
		

Crossrefs

Cf. A004754 (10), A004755 (11), A004756 (100), A004757 (101), A004759 (111).

Programs

  • Haskell
    import Data.List (transpose)
    a004758 n = a004758_list !! (n-1)
    a004758_list = 6 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004758_list
    -- Reinhard Zumkeller, Dec 03 2015
    
  • Mathematica
    w = {1, 1, 0}; Select[Range[5, 213], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* or *)
    Table[n + 5*2^Floor@ Log2@ n, {n, 53}] (* Michael De Vlieger, Aug 10 2016 *)
  • PARI
    a(n)=n+5*2^floor(log(n)/log(2))
    
  • Python
    def A004758(n): return n+(5<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 5*[n==0].
a(n) = n + 5 * 2^floor(log_2(n)) = A004757(n) + A053644(n).
a(2^m+k) = 6*2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A004756 Binary expansion starts 100.

Original entry on oeis.org

4, 8, 9, 16, 17, 18, 19, 32, 33, 34, 35, 36, 37, 38, 39, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153
Offset: 1

Views

Author

Keywords

Examples

			18 in binary is 10010, so 18 is in sequence.
		

Crossrefs

Cf. A004754 (10), A004755 (11), A004757 (101), A004758 (110), A004759 (111).

Programs

  • Haskell
    import Data.List (transpose)
    a004756 n = a004756_list !! (n-1)
    a004756_list = 4 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004756_list
    -- Reinhard Zumkeller, Dec 04 2015
    
  • Mathematica
    Select[Range[4, 153], Take[IntegerDigits[#, 2], 3] == {1, 0, 0} &] (* Michael De Vlieger, Aug 07 2016 *)
  • PARI
    a(n)=n+3*2^floor(log(n)/log(2))
    
  • Python
    def A004756(n): return n+(3<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 3*[n==0].
a(n) = n + 3 * 2^floor(log_2(n)) = A004755(n) + A053644(n).
a(2^m+k) = 2^(m+2) + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 07 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A122872 Table by antidiagonals, T(n,k) is k-th number that starts with n in binary representation.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 4, 5, 6, 4, 5, 8, 7, 8, 5, 6, 9, 12, 9, 10, 6, 7, 10, 13, 16, 11, 12, 7, 8, 11, 14, 17, 20, 13, 14, 8, 9, 16, 15, 18, 21, 24, 15, 16, 9, 10, 17, 24, 19, 22, 25, 28, 17, 18, 10, 11, 18, 25, 32, 23, 26, 29, 32, 19, 20, 11, 12, 19, 26, 33, 40, 27, 30, 33, 36, 21, 22, 12
Offset: 1

Views

Author

Keywords

Comments

In rows n through 2n-1, every integer >= n occurs exactly once.

Examples

			Top left corner is:
1 2 3 4 5
2 4 5 8 9
3 6 7 12 13
4 8 9 16 17
5 10 11 20 21
		

Crossrefs

Rows: A000027, A004754, A004755, A004756, A004757, A004758, A004759. Algebraically, A053645 would be row zero, minus A080079 would be row minus one. See also A053644.

Formula

T(n,1) = n; T(n,2k) = 2T(n,k); T(n,2k+1) = 2T(n,k) + 1. T(n,k) = k + (n-1) * 2^floor(log_2(k)) = k + (n-1)*A053644(k).
Showing 1-7 of 7 results.