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.

A121539 Numbers whose binary expansion ends in an even number of 1's.

Original entry on oeis.org

0, 2, 3, 4, 6, 8, 10, 11, 12, 14, 15, 16, 18, 19, 20, 22, 24, 26, 27, 28, 30, 32, 34, 35, 36, 38, 40, 42, 43, 44, 46, 47, 48, 50, 51, 52, 54, 56, 58, 59, 60, 62, 63, 64, 66, 67, 68, 70, 72, 74, 75, 76, 78, 79, 80, 82, 83, 84, 86, 88, 90, 91, 92, 94, 96, 98, 99, 100
Offset: 1

Views

Author

Zak Seidov, Aug 08 2006

Keywords

Comments

Equivalently, increasing sequence defined by: "if k appears a*k+b does not", case a(1)=0, a=2, b=1.
Every even number ends with zero 1's and zero is even, so every even number is a term.
Consists of all even numbers together with A131323.
A035263(a(n)) = 1. - Reinhard Zumkeller, Mar 01 2012

Examples

			11 in binary is 1011, which ends with two 1's.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a121539 n = a121539_list !! (n-1)
    a121539_list = elemIndices 1 a035263_list
    -- Reinhard Zumkeller, Mar 01 2012
    
  • Magma
    [n: n in [0..200] | Valuation(n+1, 2) mod 2 eq 0 ]; // Vincenzo Librandi, Apr 16 2015
    
  • Mathematica
    s={2}; With[{a=2,b=1},Do[If[FreeQ[s,(n-b)/a],AppendTo[s,n]],{n,3,100}]];s
  • PARI
    is(n)=valuation(n+1,2)%2==0 \\ Charles R Greathouse IV, Sep 23 2012
    
  • Python
    def ok(n): b = bin(n)[2:]; return (len(b) - len(b.rstrip('1')))%2 == 0
    print(list(filter(ok, range(101)))) # Michael S. Branicky, Jun 18 2021
    
  • Python
    def A121539(n):
        def f(x):
            c, s = n+x, bin(x)[2:]
            l = len(s)
            for i in range(l&1^1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m-1 # Chai Wah Wu, Jan 29 2025

Formula

A010060(a(n)) + A010060(a(n)+1) = 1. - Vladimir Shevelev, Jun 16 2009
a(n) = A003159(n) - 1. - Reinhard Zumkeller, Mar 01 2012
a(n) = (3/2)*n + O(log n). - Charles R Greathouse IV, Sep 23 2012

Extensions

Edited by N. J. A. Sloane at the suggestion of Stefan Steinerberger, Dec 17 2007

A121538 Increasing sequence: "if n appears then a*n+b doesn't", case a(1)=1, a=2, b=1.

Original entry on oeis.org

1, 2, 4, 6, 7, 8, 10, 11, 12, 14, 16, 18, 19, 20, 22, 24, 26, 27, 28, 30, 31, 32, 34, 35, 36, 38, 40, 42, 43, 44, 46, 47, 48, 50, 51, 52, 54, 56, 58, 59, 60, 62, 64, 66, 67, 68, 70, 72, 74, 75, 76, 78, 79, 80, 82, 83, 84, 86, 88, 90, 91, 92, 94, 96, 98, 99, 100
Offset: 1

Views

Author

Zak Seidov, Aug 06 2006

Keywords

Comments

A positive integer n is in A121538 iff any of the following is true: 1) n is even; 2) n+1 = 2^k where k is odd; 3) n+1 = 2^k*(2*t+1) where t>0 and k is even. - Max Alekseyev, Aug 07 2006

Crossrefs

Programs

  • Mathematica
    s={s1=1};With[{a=2,b=1},Do[If[FreeQ[s,(n-b)/a],AppendTo[s,n]],{n,s1+1,100}]];s

Formula

This is essentially A053661-1. - David W. Wilson, Aug 07 2006

A121541 Increasing sequence: "if n appears a*n+b does not", case a(1)=4, a=2, b=1.

Original entry on oeis.org

4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 19, 20, 22, 23, 24, 26, 27, 28, 30, 31, 32, 34, 35, 36, 38, 40, 42, 43, 44, 46, 48, 50, 51, 52, 54, 56, 58, 59, 60, 62, 64, 66, 67, 68, 70, 72, 74, 75, 76, 78, 79, 80, 82, 83, 84, 86, 88, 90, 91, 92, 94, 95, 96, 98, 99, 100
Offset: 1

Views

Author

Zak Seidov, Aug 08 2006

Keywords

Crossrefs

Programs

  • Mathematica
    s={4};With[{a=2,b=1},Do[If[FreeQ[s,(n-b)/a],AppendTo[s,n]],{n,5,100}]];s

A121542 Increasing sequence: "if n appears a*n+b does not", case a(1)=5, a=2, b=1.

Original entry on oeis.org

5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 23, 24, 26, 27, 28, 30, 31, 32, 34, 35, 36, 38, 39, 40, 42, 43, 44, 46, 48, 50, 51, 52, 54, 56, 58, 59, 60, 62, 64, 66, 67, 68, 70, 72, 74, 75, 76, 78, 80, 82, 83, 84, 86, 88, 90, 91, 92, 94, 95, 96, 98, 99, 100
Offset: 1

Views

Author

Zak Seidov, Aug 08 2006

Keywords

Crossrefs

Programs

  • Mathematica
    s={5};With[{a=2,b=1},Do[If[FreeQ[s,(n-b)/a],AppendTo[s,n]],{n,6,100}]];s
Showing 1-4 of 4 results.