A357773 Odd numbers with two zeros in their binary expansion.
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
Crossrefs
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
Comments