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

A358654 a(n) = A025480(A353654(n+1) - 1).

Original entry on oeis.org

0, 1, 3, 2, 7, 5, 6, 15, 4, 11, 13, 14, 31, 9, 10, 23, 12, 27, 29, 30, 63, 8, 19, 21, 22, 47, 25, 26, 55, 28, 59, 61, 62, 127, 17, 18, 39, 20, 43, 45, 46, 95, 24, 51, 53, 54, 111, 57, 58, 119, 60, 123, 125, 126, 255, 16, 35, 37, 38, 79, 41, 42, 87, 44, 91, 93
Offset: 0

Views

Author

Mikhail Kurkov, Nov 25 2022

Keywords

Comments

Permutation of the nonnegative integers.
Conjecture: A247648(n) with rewrite 1 -> 1, 01 -> 0 applied to binary expansion is the same as a(n).

Crossrefs

Formula

Conjecture: a(n) = A348366(A343152(n)) for n > 0 with a(0) = 1.

A356385 First differences of A353654 which is numbers with the same number of trailing 0 bits as other 0 bits.

Original entry on oeis.org

2, 4, 3, 5, 7, 4, 5, 5, 10, 8, 4, 5, 13, 8, 10, 6, 10, 8, 4, 5, 9, 20, 16, 8, 10, 14, 8, 10, 6, 10, 8, 4, 5, 25, 16, 20, 12, 20, 16, 8, 10, 10, 20, 16, 8, 10, 14, 8, 10, 6, 10, 8, 4, 5, 17, 40, 32, 16, 20, 28, 16, 20, 12, 20, 16, 8, 10, 26, 16, 20, 12, 20, 16
Offset: 1

Views

Author

Mikhail Kurkov, Aug 05 2022

Keywords

Crossrefs

Programs

  • Mathematica
    Differences @ Join[{1}, Select[Range[2, 1000], IntegerExponent[#, 2] == Floor[Log2[# - 1]] - DigitCount[# - 1, 2, 1] &]] (* Amiram Eldar, Sep 21 2022 *)
  • PARI
    isok(k) = if (k==1, 1, (logint(k-1, 2)-hammingweight(k-1) == valuation(k, 2))); \\ A353654
    lista(nn) = my(v=select(isok, [1..nn])); vector(#v-1, k, v[k+1] - v[k]); \\ Michel Marcus, Sep 21 2022
    (Python 3.10+)
    from itertools import pairwise, count, islice
    def A356385_gen(): # generator of terms
        return map(lambda x:x[1]-x[0],pairwise(filter(lambda n:(~n & n-1).bit_length()<<1 == n.bit_length()-n.bit_count(),count(1))))
    A356385_list = list(islice(A356385_gen(),30)) # Chai Wah Wu, Oct 14 2022

Formula

a(n) = A353654(n+1) - A353654(n) for n > 0.
a(A000045(n)-1) = 5 for n > 4.

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)

A357773 Odd numbers with two zeros in their binary expansion.

Original entry on oeis.org

9, 19, 21, 25, 39, 43, 45, 51, 53, 57, 79, 87, 91, 93, 103, 107, 109, 115, 117, 121, 159, 175, 183, 187, 189, 207, 215, 219, 221, 231, 235, 237, 243, 245, 249, 319, 351, 367, 375, 379, 381, 415, 431, 439, 443, 445, 463, 471, 475, 477, 487, 491, 493, 499, 501
Offset: 1

Views

Author

Bernard Schott, Oct 12 2022

Keywords

Comments

A048490 \ {1} is a subsequence, since for m >= 1, A048490(m) = 8*2^m - 7 has 11..11001 with m starting 1 for binary expansion.
A153894 \ {4} is a subsequence, since for m >= 1, A153894(m) = 5*2^m - 1 has 10011..11 with m trailing 1 for binary expansion.
A220236 is a subsequence, since for m >= 1, A220236(m) = 2^(2*m + 2) - 2^(m + 1) - 2^m - 1 has 11..110011..11 with m starting 1 and m trailing 1 for binary expansion.
For k > 2, there are (k-1)*(k-2)/2 terms between 2^k and 2^(k+1), or equivalently (k-1)*(k-2)/2 terms with k+1 bits.
Binary expansion of a(n) is A357774(n).
{4*a(n), n>0} form a subsequence of A353654 (numbers with two trailing 0 bits and two other 0 bits).

Crossrefs

Odd numbers with k zeros in their binary expansion: A000225 (k=0), A190620 (k=1).
Subsequences: A048490 \ {1}, A153894 \ {4}, A220236.

Programs

  • Maple
    seq(seq(seq(2^n-1-2^i-2^j,j=i-1..1,-1),i=n-2..1,-1),n=4..10); # Robert Israel, Oct 13 2022
  • Mathematica
    Select[Range[1, 500, 2], DigitCount[#, 2, 0] == 2 &] (* Amiram Eldar, Oct 12 2022 *)
  • PARI
    isok(k) = (k%2) && (#binary(k) == hammingweight(k)+2); \\ Michel Marcus, Oct 13 2022
    
  • PARI
    list(lim)=my(v=List()); for(n=4,logint(lim\=1,2)+1, my(N=2^n-1); forstep(a=n-2,2,-1, my(A=N-1<lim, break(2)); listput(v,t)))); Vec(v) \\ Charles R Greathouse IV, Oct 21 2022
  • Python
    def a(n):
        m = 0
        while m*(m+1)*(m+2)//6 <= n: m += 1
        m -= 1 # m = A056556(n-1)
        k, r, j = m + 4, n - m*(m+1)*(m+2)//6, 0
        while r >= 0: r -= (m+1-j); j += 1
        j += 1
        return 2**k - 2**(k-j) - 2**(-r) - 1
    print([a(n) for n in range(60)]) # Michael S. Branicky, Oct 12 2022
    
  • Python
    # faster version for generating initial segment of sequence
    from itertools import combinations, count, islice
    def agen():
        for d in count(4):
            b, c = 2**d - 1, 2**(d-1)
            for i, j in combinations(range(1, d-1), 2):
                yield b - (c >> i) - (c >> j)
    print(list(islice(agen(), 60))) # Michael S. Branicky, Oct 13 2022
    
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A357773(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 (1<Chai Wah Wu, Dec 17 2024
    

Formula

A023416(a(n)) = 2.
a((n-1)*(n-2)*(n-3)/6 - (i-1)*(i-2)/2 - (j-1)) = 2^n - 2^i - 2^j - 1 for 1 <= j < i <= n-2. - Robert Israel, Oct 13 2022

Extensions

a(11) and beyond from Michael S. Branicky, Oct 12 2022

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
Showing 1-5 of 5 results.