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

A190620 Odd numbers with a single zero in their binary expansion.

Original entry on oeis.org

5, 11, 13, 23, 27, 29, 47, 55, 59, 61, 95, 111, 119, 123, 125, 191, 223, 239, 247, 251, 253, 383, 447, 479, 495, 503, 507, 509, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 3071, 3583, 3839, 3967, 4031
Offset: 1

Views

Author

Reinhard Zumkeller, May 14 2011

Keywords

Comments

Odd numbers such that the binary weight is one less than the number of significant digits. Except for the initial 0, A129868 is a subsequence of this sequence. - Alonso del Arte, May 14 2011
From Bernard Schott, Oct 20 2022: (Start)
A036563 \ {-2, -1, 1} is a subsequence, since for m >= 3, A036563(m) = 2^m - 3 has 11..1101 with (m-2) starting 1's for binary expansion.
A083329 \ {1, 2} is a subsequence, since for m >= 2, A083329(m) = 3*2^(m-1) - 1 has 1011..11 with (m-1) trailing 1's for binary expansion.
A129868 \ {0} is a subsequence, since for m >= 1, A129868(m) = 2*4^m - 2^m - 1 is a binary cyclops number that has 11..11011..11 with m starting 1's and m trailing 1's for binary expansion.
The 0-bit position in binary expansion of a(n) is at rank A004736(n) + 1 from the right.
For k >= 2, there are (k-1) terms between 2^k and 2^(k+1), or equivalently (k-1) terms with (k+1) bits.
{2*a(n), n>0} form a subsequence of A353654 (numbers with one trailing 0 bit and one other 0 bit). (End)

Crossrefs

A036563 \ {-2, -1, 1}, A083329 \ {1, 2}, A129868 are subsequences.
Odd numbers with k zeros in their binary expansion: A000225 (k=0), A357773 (k=2).

Programs

  • Haskell
    import Data.List (elemIndices)
    a190620 n = a190620_list !! (n-1)
    a190620_list = filter odd $ elemIndices 1 a023416_list
    -- A more efficient version, inspired by the Maple program in A190619:
    a190620_list' = g 8 2 where
       g m 2 = (m - 3) : g (2*m) (m `div` 2)
       g m k = (m - k - 1) : g m (k `div` 2)
    
  • Maple
    isA := proc(n) convert(n, base, 2): %[1] = nops(%) - add(%) end:
    select(isA, [$1..4031]); # Peter Luschny, Oct 27 2022
    # Alternatively, using a formula of Bernard Schott and A123578:
    A190620 := proc(n) A123578(n); 4*2^% - 2^(1 - n + (% + %^2)/2) - 1 end:
    seq(A190620(n), n = 1..50); # Peter Luschny, Oct 28 2022
  • Mathematica
    Select[Range[1,5001,2],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Jul 12 2018 *)
  • Python
    from itertools import count, islice
    def agen():
        for d in count(3):
            b = 1 << d
            for i in range(2, d):
                yield b - (b >> i) - 1
    print(list(islice(agen(), 50))) # Michael S. Branicky, Oct 13 2022
    
  • Python
    from math import isqrt, comb
    def A190620(n): return (1<<(a:=(isqrt(n<<3)+1>>1)+1)+1)-(1<Chai Wah Wu, Dec 18 2024

Formula

A190619(n) = A007088(a(n));
A023416(a(n)) = 1.
From Bernard Schott, Oct 21 2022: (Start)
a((n-1)*(n-2)/2 - (i-1)) = 2^n - 2^i - 1 for n >= 3 and 1 <= i <= n-2 (after Robert Israel in A357773).
a(n) = A000225(A002024(n)+2) - A000079(A004736(n)).
a(n) = 4*2^k(n) - 2^(1 - n + (k(n) + k(n)^2)/2) - 1, where k is the Kruskal-Macaulay function A123578.
A070939(a(n)) = A002024(n) + 2. (End)

A357774 Binary expansions of odd numbers with two zeros in their binary expansion.

Original entry on oeis.org

1001, 10011, 10101, 11001, 100111, 101011, 101101, 110011, 110101, 111001, 1001111, 1010111, 1011011, 1011101, 1100111, 1101011, 1101101, 1110011, 1110101, 1111001, 10011111, 10101111, 10110111, 10111011, 10111101, 11001111, 11010111, 11011011, 11011101, 11100111, 11101011
Offset: 1

Views

Author

Bernard Schott, Oct 19 2022

Keywords

Comments

For m >= 4, there are A000217(m-3) terms with m digits.

Crossrefs

A267524 \ {1, 10, 100} and A267705 \ {1, 10} are two subsequences.
Similar, but with k zeros in their binary expansion: A000042 (k=0), A190619 (k=1).

Programs

  • Mathematica
    FromDigits[IntegerDigits[#, 2]] & /@ Select[Range[1, 250, 2], DigitCount[#, 2, 0] == 2 &] (* Amiram Eldar, Oct 19 2022 *)
  • PARI
    isok(k) = (k%2) && (#binary(k) == hammingweight(k)+2); \\ A357773
    f(n) = fromdigits(binary(n), 10); \\ A007088
    lista(nn) = apply(f, select(isok, [1..nn])); \\ Michel Marcus, Oct 19 2022
  • Python
    from itertools import combinations, count, islice
    def agen(): # generator of terms
        for d in count(4):
            b, c = 2**d - 1, 2**(d-1)
            for i, j in combinations(range(1, d-1), 2):
                yield int(bin(b - (c >> i) - (c >> j))[2:])
    print(list(islice(agen(), 30))) # Michael S. Branicky, Oct 19 2022
    
  • Python
    from itertools import count, islice
    def A357774_gen(): # generator of terms
        for l in count(2):
            m = (10**(l+2)-1)//9
            for i in range(l,0,-1):
                k = m-10**i
                yield from (k-10**j for j in range(i-1,0,-1))
    A357774_list = list(islice(A357774_gen(),30)) # Chai Wah Wu, Feb 19 2023
    
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A357774(n):
        a = (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2,3))+3
        b = isqrt((j:=comb(a-1,3)-n+1)<<3)+3>>1
        c = j-comb((r:=isqrt(w:=j<<1))+(w>r*(r+1)),2)
        return (10**a-1)//9-10**b-10**c # Chai Wah Wu, Dec 19 2024
    

Formula

a(n) = A007088(A357773(n)).

A360574 Binary expansions of odd numbers with three zeros in their binary expansion.

Original entry on oeis.org

10001, 100011, 100101, 101001, 110001, 1000111, 1001011, 1001101, 1010011, 1010101, 1011001, 1100011, 1100101, 1101001, 1110001, 10001111, 10010111, 10011011, 10011101, 10100111, 10101011, 10101101, 10110011, 10110101, 10111001, 11000111, 11001011, 11001101, 11010011, 11010101, 11011001, 11100011
Offset: 1

Views

Author

Bernard Schott, Feb 18 2023

Keywords

Comments

For m >= 5, there are A000292(m-4) terms with m digits.

Examples

			1010101 has three digits 0 and is the binary expansion of the odd integer 85, so 1010101 is a term.
		

Crossrefs

Similar, but with k zeros in their binary expansion: A000042 (k=0), A190619 (k=1), A357774 (k=2).

Programs

  • Mathematica
    FromDigits[IntegerDigits[#, 2]] & /@ Select[Range[1, 250, 2], DigitCount[#, 2, 0] == 3 &] (* Amiram Eldar, Feb 18 2023 *)
  • Python
    from itertools import count, islice
    from sympy.utilities.iterables import multiset_permutations
    def A360574_gen(): # generator of terms
        yield from (int('1'+''.join(d)+'1') for l in count(0) for d in  multiset_permutations('000'+'1'*l))
    A360574_list = list(islice(A360574_gen(),30)) # Chai Wah Wu, Feb 18 2023

Formula

a(n) = A007088(A360573(n)).
Showing 1-3 of 3 results.