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.

A004780 Binary expansion contains 2 adjacent 1's.

Original entry on oeis.org

3, 6, 7, 11, 12, 13, 14, 15, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 35, 38, 39, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 70, 71, 75, 76, 77, 78, 79, 83, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

Keywords

Comments

Complement of A003714. It appears that n is in the sequence if and only if C(3n,n) is even. - Benoit Cloitre, Mar 09 2003
Since the binary representation of these numbers contains two adjacent 1's, so for these values of n, we will have (n XOR 2n XOR 3n) != 0, and thus a two player Nim game with three heaps of (n, 2n, 3n) stones will be a winning configuration for the first player. - V. Raman, Sep 17 2012
A048728(a(n)) > 0. - Reinhard Zumkeller, May 13 2014
The set of numbers x such that Or(x,3*x) <> 3*x. - Gary Detlefs, Jun 04 2024

Crossrefs

Complement: A003714.
Subsequences (apart from any initial zero-term): A001196, A004755, A004767, A033428, A277335.

Programs

  • Haskell
    a004780 n = a004780_list !! (n-1)
    a004780_list = filter ((> 1) . a048728) [1..]
    -- Reinhard Zumkeller, May 13 2014
    
  • Maple
    q:= n-> verify([1$2], Bits[Split](n), 'sublist'):
    select(q, [$0..200])[];  # Alois P. Heinz, Oct 22 2021
  • PARI
    is(n)=bitand(n,n+n)>0 \\ Charles R Greathouse IV, Sep 19 2012
    
  • Python
    from itertools import count, islice
    def A004780_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:n&(n<<1), count(max(startvalue,1)))
    A004780_list = list(islice(A004780_gen(),30)) # Chai Wah Wu, Jul 13 2022

Formula

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

Extensions

Offset corrected by Reinhard Zumkeller, Jul 28 2010