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

A003796 Numbers with no 3 adjacent 0's in binary expansion.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A004779.
Cf. A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004742 (no 101), A004743 (no 110), A003726 (no 111).

Programs

  • Haskell
    a003796 n = a003796_list !! (n-1)
    a003796_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 0 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
    
  • Mathematica
    Select[Range[0,100],SequenceCount[IntegerDigits[#,2],{0,0,0}]==0&] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Sep 12 2015 *)
  • PARI
    is(n)=while(n>7,if(bitand(n,7)==0,return(0));n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017

Formula

Sum_{n>=2} 1/a(n) = 9.829256652701616366441622119246549956902006567009112470631751387637507184399... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A004781 Binary expansion contains 3 adjacent 1's.

Original entry on oeis.org

7, 14, 15, 23, 28, 29, 30, 31, 39, 46, 47, 55, 56, 57, 58, 59, 60, 61, 62, 63, 71, 78, 79, 87, 92, 93, 94, 95, 103, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 135, 142, 143, 151, 156, 157, 158, 159, 167
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A003726.

Programs

  • Haskell
    a004781 n = a004781_list !! (n - 1)
    a004781_list = filter f [0..] where
       f x | x < 7     = False
           | otherwise = (x `mod` 8) == 7 || f (x `div` 2)
    -- Reinhard Zumkeller, Jun 03 2012
    
  • Maple
    q:= n-> verify([1$3], Bits[Split](n), 'sublist'):
    select(q, [$0..200])[];  # Alois P. Heinz, Oct 22 2021
  • Mathematica
    Select[Range[200],MemberQ[Partition[IntegerDigits[#,2],3,1], {1,1,1}]&]  (* Harvey P. Dale, Mar 31 2011 *)
    Select[Range[200], StringContainsQ[IntegerString[#, 2], "111"] &] (* Amiram Eldar, Oct 22 2021 *)
    Select[Range[200],SequenceCount[IntegerDigits[#,2],{1,1,1}]>0&] (* Harvey P. Dale, Dec 28 2021 *)
  • PARI
    is(n)=!!bitand(bitand(n,n<<1),n<<2) \\ Charles R Greathouse IV, Sep 24 2012

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 24 2012

Extensions

Offset corrected by Reinhard Zumkeller, Jun 03 2012

A136037 Numbers with at least three adjacent equal digits in binary representation.

Original entry on oeis.org

7, 8, 14, 15, 16, 17, 23, 24, 28, 29, 30, 31, 32, 33, 34, 35, 39, 40, 46, 47, 48, 49, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 78, 79, 80, 81, 87, 88, 92, 93, 94, 95, 96, 97, 98, 99, 103, 104, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 11 2007

Keywords

Crossrefs

Cf. A007088.
Complement of A063037; union of A004779 and A004781.
Supersequence of A037970.

Programs

  • Mathematica
    Select[Range[150],SequenceCount[IntegerDigits[#,2],{x_,x_,x_}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 04 2020 *)
  • Python
    def ok(n): b = bin(n)[2:]; return "000" in b or "111" in b
    print(list(filter(ok, range(120)))) # Michael S. Branicky, Jul 08 2021

A300302 Square array T(n, k) (n >= 1, k >= 1) read by antidiagonals upwards: T(n, k) is the k-th positive number whose binary representation contains the binary representation of n as a substring.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 08 2018

Keywords

Comments

Each positive number k appears A122953(k) times in this array.

Examples

			Square array begins:
  n\k|    1    2    3    4    5    6    7    8    9   10
  ---+--------------------------------------------------
    1|    1    2    3    4    5    6    7    8    9   10  <--  A000027
    2|    2    4    5    6    8    9   10   11   12   13  <--  A062289
    3|    3    6    7   11   12   13   14   15   19   22  <--  A004780
    4|    4    8    9   12   16   17   18   19   20   24  <--  A004753
    5|    5   10   11   13   20   21   22   23   26   27  <--  A004748
    6|    6   12   13   14   22   24   25   26   27   28  <--  A004749
    7|    7   14   15   23   28   29   30   31   39   46  <--  A004781
    8|    8   16   17   24   32   33   34   35   40   48  <--  A004779
    9|    9   18   19   25   36   37   38   39   41   50
   10|   10   20   21   26   40   41   42   43   52   53  <--  A132782
		

Crossrefs

Programs

  • Perl
    See Links section.

Formula

T(n, 1) = n.
T(n, 2) = 2*n.
T(n, 3) = 2*n + 1.
T(1, n) = A000027(n).
T(2, n) = A062289(n).
T(3, n) = A004780(n).
T(4, n) = A004753(n).
T(5, n) = A004748(n).
T(6, n) = A004749(n).
T(7, n) = A004781(n).
T(8, n) = A004779(n-1).
T(10, n) = A132782(n).
Showing 1-4 of 4 results.