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-6 of 6 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)

A353654 Numbers whose binary expansion has the same number of trailing 0 bits as other 0 bits.

Original entry on oeis.org

1, 3, 7, 10, 15, 22, 26, 31, 36, 46, 54, 58, 63, 76, 84, 94, 100, 110, 118, 122, 127, 136, 156, 172, 180, 190, 204, 212, 222, 228, 238, 246, 250, 255, 280, 296, 316, 328, 348, 364, 372, 382, 392, 412, 428, 436, 446, 460, 468, 478, 484, 494, 502, 506, 511, 528, 568
Offset: 1

Views

Author

Mikhail Kurkov, Jul 15 2022

Keywords

Comments

Numbers k such that A007814(k) = A086784(k).
To reproduce the sequence through itself, use the following rule: if binary 1xyz is a term then so are 11xyz and 10xyz0 (except for 1 alone where 100 is not a term).
The number of terms with bit length k is equal to Fibonacci(k-1) for k > 1.
Conjecture: 2*A247648(n-1) + 1 with rewrite 1 -> 1, 01 -> 0 applied to binary expansion is the same as a(n) without trailing 0 bits in binary.
Odd terms are positive Mersenne numbers (A000225), because there is no 0 in their binary expansion. - Bernard Schott, Oct 12 2022

Crossrefs

Cf. A356385 (first differences).
Subsequences with same number k of trailing 0 bits and other 0 bits: A000225 (k=0), 2*A190620 (k=1), 4*A357773 (k=2), 8*A360573 (k=3).

Programs

  • Maple
    N:= 10: # for terms <= 2^N
    S:= {1};
    for d from 1 to N do
      for k from 0 to d/2-1 do
        B:= combinat:-choose([$k+1..d-2],k);
        S:= S union convert(map(proc(t) local s; 2^d - 2^k - add(2^(s),s=t) end proc,B),set);
    od od:
    sort(convert(S,list)); # Robert Israel, Sep 21 2023
  • Mathematica
    Join[{1}, Select[Range[2, 600], IntegerExponent[#, 2] == Floor[Log2[# - 1]] - DigitCount[# - 1, 2, 1] &]] (* Amiram Eldar, Jul 16 2022 *)
  • PARI
    isok(k) = if (k==1, 1, (logint(k-1, 2)-hammingweight(k-1) == valuation(k, 2))); \\ Michel Marcus, Jul 16 2022
    
  • Python
    from itertools import islice, count
    def A353654_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:(m:=(~n & n-1).bit_length()) == bin(n>>m)[2:].count('0'),count(max(startvalue,1)))
    A353654_list = list(islice(A353654_gen(),30)) # Chai Wah Wu, Oct 14 2022

Formula

a(n) = a(n-1) + A356385(n-1) for n > 1 with a(1) = 1.
Conjectured formulas: (Start)
a(n) = 2^g(n-1)*(h(n-1) + 2^A000523(h(n-1))*(2 - g(n-1))) for n > 2 with a(1) = 1, a(2) = 3 where f(n) = n - A130312(n), g(n) = [n > 2*f(n)] and where h(n) = a(f(n) + 1).
a(n) = 1 + 2^r(n-1) + Sum_{k=1..r(n-1)} (1 - g(s(n-1, k)))*2^(r(n-1) - k) for n > 1 with a(1) = 1 where r(n) = A072649(n) and where s(n, k) = f(s(n, k-1)) for n > 0, k > 1 with s(n, 1) = n.
a(n) = 2*(2 + Sum_{k=1..n-2} 2^(A213911(A280514(k)-1) + 1)) - 2^A200650(n) for n > 1 with a(1) = 1.
A025480(a(n)-1) = A348366(A343152(n-1)) for n > 1.
a(A000045(n)) = 2^(n-1) - 1 for n > 1. (End)

A360573 Odd numbers with exactly three zeros in their binary expansion.

Original entry on oeis.org

17, 35, 37, 41, 49, 71, 75, 77, 83, 85, 89, 99, 101, 105, 113, 143, 151, 155, 157, 167, 171, 173, 179, 181, 185, 199, 203, 205, 211, 213, 217, 227, 229, 233, 241, 287, 303, 311, 315, 317, 335, 343, 347, 349, 359, 363, 365, 371, 373, 377, 399, 407, 411, 413
Offset: 1

Views

Author

Bernard Schott, Feb 12 2023

Keywords

Comments

If m is a term then 2*m+1 is another term, since if M is the binary expansion of m, then M.1 where . stands for concatenation is the binary expansion of 2*m+1.
A052996 \ {1,3,8} is a subsequence, since for m >= 3, A052996(m) = 9*2^(m-2) - 1 has 100011..11 with m-2 trailing 1 for binary expansion.
A171389 \ {20} is a subsequence, since for m >= 1, A171389(m) = 21*2^m - 1 has 1010011..11 with m trailing 1 for binary expansion.
A198276 \ {18} is a subsequence, since for m >= 1, A198276(m) = 19*2^m - 1 has 1001011..11 with m trailing 1 for binary expansion.
Binary expansion of a(n) is A360574(n).
{8*a(n), n>0} form a subsequence of A353654 (numbers with three trailing 0 bits and three other 0 bits).
Numbers of the form 2^(a+1) - 2^b - 2^c - 2^d - 1 where a > b > c > d > 0. - Robert Israel, Feb 13 2023

Examples

			35_10 = 100011_2, so 35 is a term.
		

Crossrefs

Subsequences: A052996 \ {1,3,8}, A171389 \ {20}, A198276 \ {18}.
Odd numbers with k zeros in their binary expansion: A000225 (k=0), A190620 (k=1), A357773 (k=2), this sequence (k=3).

Programs

  • Maple
    q:= n-> n::odd and add(1-i, i=Bits[Split](n))=3:
    select(q, [$1..575])[];  # Alois P. Heinz, Feb 12 2023
    # Alternative:
    [seq(seq(seq(seq(2^(a+1) - 2^b - 2^c - 2^d - 1, d = c-1..1,-1), c=b-1..2,-1),b=a-1..3,-1),a=4..12)]; # Robert Israel, Feb 13 2023
  • Mathematica
    Select[Range[1, 500, 2], DigitCount[#, 2, 0] == 3 &] (* Amiram Eldar, Feb 12 2023 *)
  • PARI
    isok(m) = (m%2) && #select(x->(x==0), binary(m)) == 3; \\ Michel Marcus, Feb 13 2023
  • Python
    def ok(n): return n&1 and bin(n)[2:].count("0") == 3
    print([k for k in range(414) if ok(k)]) # Michael S. Branicky, Feb 12 2023
    
  • Python
    from itertools import count, islice
    from sympy.utilities.iterables import multiset_permutations
    def A360573_gen(): # generator of terms
        yield from (int('1'+''.join(d)+'1',2) for l in count(0) for d in  multiset_permutations('000'+'1'*l))
    A360573_list = list(islice(A360573_gen(),54)) # Chai Wah Wu, Feb 18 2023
    
  • Python
    from itertools import combinations, count, islice
    def agen(): yield from ((1<Michael S. Branicky, Feb 18 2023
    
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1), 3)[0])-(nA333516(n): return (r:=n-1-comb((m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))+1, 3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)), 2)+1
    def A360010(n): return (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))
    def A360573(n):
        a = (a2:=integer_nthroot(24*n, 4)[0])+(n>comb(a2+2, 4))+3
        j = comb(a-1,4)-n
        b, c, d = A360010(j+1)+2, A056557(j)+2, A333516(j+1)
        return (1<Chai Wah Wu, Dec 18 2024
    

Formula

A023416(a(n)) = 3.
Let a = floor((24n)^(1/4))+4 if n>binomial(floor((24n)^(1/4))+2,4) and a = floor((24n)^(1/4))+3 otherwise. Let j = binomial(a-1,4)-n. Then a(n) = 2^a-1-2^(A360010(j+1)+2)-2^(A056557(j)+2)-2^(A333516(j+1)). - Chai Wah Wu, Dec 18 2024

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)).

A379267 Numbers whose binary representation contains exactly two zeros.

Original entry on oeis.org

4, 9, 10, 12, 19, 21, 22, 25, 26, 28, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 79, 87, 91, 93, 94, 103, 107, 109, 110, 115, 117, 118, 121, 122, 124, 159, 175, 183, 187, 189, 190, 207, 215, 219, 221, 222, 231, 235, 237, 238, 243, 245, 246, 249, 250, 252, 319, 351
Offset: 1

Views

Author

Chai Wah Wu, Dec 19 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[351],Count[IntegerDigits[#,2],0]==2&] (* James C. McMahon, Dec 20 2024 *)
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A379267(n):
        a = (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2,3))+2
        b = isqrt((j:=comb(a,3)-n+1)<<3)+1>>1
        c = j-comb((r:=isqrt(w:=j<<1))+(w>r*(r+1)),2)-1
        return (1<
    				

Formula

a(n) = (A357773(n)-1)/2.
A023416(a(n)) = 2.
Sum_{n>=1} 1/a(n) = 1.4121825365494357179372249141360906507417257788239800327155414852526863441610798293625536351899799813... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Dec 21 2024

A379268 Numbers with only digits "1" and two digits "0".

Original entry on oeis.org

100, 1001, 1010, 1100, 10011, 10101, 10110, 11001, 11010, 11100, 100111, 101011, 101101, 101110, 110011, 110101, 110110, 111001, 111010, 111100, 1001111, 1010111, 1011011, 1011101, 1011110, 1100111, 1101011, 1101101, 1101110, 1110011, 1110101, 1110110, 1111001
Offset: 1

Views

Author

Chai Wah Wu, Dec 19 2024

Keywords

Comments

Binary representation of A379267.
Numbers in A007088 with two 0 digits.

Crossrefs

Programs

  • Mathematica
    Select[Range[10^7],Count[IntegerDigits[#],0]==2&&Max[IntegerDigits[#]]==1&] (* James C. McMahon, Dec 20 2024 *)
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A379268(n):
        a = (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2,3))+2
        b = isqrt((j:=comb(a,3)-n+1)<<3)+1>>1
        c = j-comb((r:=isqrt(w:=j<<1))+(w>r*(r+1)),2)-1
        return (10**a-1)//9-10**b-10**c

Formula

a(n) = A007088(A379267(n)).
Showing 1-6 of 6 results.