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.

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