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

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

A188530 2^(2n+1)-5*2^(n-1)-1.

Original entry on oeis.org

2, 21, 107, 471, 1967, 8031, 32447, 130431, 523007, 2094591, 8383487, 33544191, 134197247, 536829951, 2147401727, 8589770751, 34359410687, 137438298111, 549754503167, 2199020634111
Offset: 1

Views

Author

Brad Clardy, Apr 03 2011

Keywords

Comments

Starting with n=2, binary palindromic numbers of the form (n-1)010(n-1) where n is the index and the number of 1's

Examples

			first 6 term in binary starting with n=2 are 10101,1101011,111010111,11110101111,1111101011111,111111010111111
		

Crossrefs

Cf. A267705.

Programs

  • Mathematica
    Table[2^(2n+1)-5 2^(n-1)-1,{n,20}] (* or *) Rest[CoefficientList[ Series[(x(-2-7x+12x^2))/((x-1)(2x-1)(4x-1)), {x,0,20}], x]]  (* Harvey P. Dale, Apr 19 2011 *)
  • Python
    print([2*4**n - 5*2**(n-1) - 1 for n in range(1, 50)]) # Karl V. Keller, Jr., Jun 09 2022

Formula

a(n) = 2^(2n+1)-2^(n+1)-2^(n-1)-1.
A052539(n) = a(n)-2*a(n-1) for n>1.
a(n)= +7*a(n-1) -14*a(n-2) +8*a(n-3). G.f. ( x*(-2-7*x+12*x^2) ) / ( (x-1)*(2*x-1)*(4*x-1) ). - R. J. Mathar, Apr 04 2011
a(n) = 2*4^n - 5*2^(n-1) - 1. - Karl V. Keller, Jr., Jun 09 2022
Showing 1-2 of 2 results.