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.

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

This page as a plain text file.
%I A360573 #56 Jun 16 2025 23:49:08
%S A360573 17,35,37,41,49,71,75,77,83,85,89,99,101,105,113,143,151,155,157,167,
%T A360573 171,173,179,181,185,199,203,205,211,213,217,227,229,233,241,287,303,
%U A360573 311,315,317,335,343,347,349,359,363,365,371,373,377,399,407,411,413
%N A360573 Odd numbers with exactly three zeros in their binary expansion.
%C A360573 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.
%C A360573 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.
%C A360573 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.
%C A360573 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.
%C A360573 Binary expansion of a(n) is A360574(n).
%C A360573 {8*a(n), n>0} form a subsequence of A353654 (numbers with three trailing 0 bits and three other 0 bits).
%C A360573 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
%F A360573 A023416(a(n)) = 3.
%F A360573 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
%e A360573 35_10 = 100011_2, so 35 is a term.
%p A360573 q:= n-> n::odd and add(1-i, i=Bits[Split](n))=3:
%p A360573 select(q, [$1..575])[];  # _Alois P. Heinz_, Feb 12 2023
%p A360573 # Alternative:
%p A360573 [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
%t A360573 Select[Range[1, 500, 2], DigitCount[#, 2, 0] == 3 &] (* _Amiram Eldar_, Feb 12 2023 *)
%o A360573 (Python)
%o A360573 def ok(n): return n&1 and bin(n)[2:].count("0") == 3
%o A360573 print([k for k in range(414) if ok(k)]) # _Michael S. Branicky_, Feb 12 2023
%o A360573 (Python)
%o A360573 from itertools import count, islice
%o A360573 from sympy.utilities.iterables import multiset_permutations
%o A360573 def A360573_gen(): # generator of terms
%o A360573     yield from (int('1'+''.join(d)+'1',2) for l in count(0) for d in  multiset_permutations('000'+'1'*l))
%o A360573 A360573_list = list(islice(A360573_gen(),54)) # _Chai Wah Wu_, Feb 18 2023
%o A360573 (Python)
%o A360573 from itertools import combinations, count, islice
%o A360573 def agen(): yield from ((1<<m)-(1<<i)-(1<<j)-(1<<k)-1 for m in count(5) for i, j, k in combinations(range(m-2,0,-1), 3))
%o A360573 print(list(islice(agen(), 54))) # _Michael S. Branicky_, Feb 18 2023
%o A360573 (Python)
%o A360573 from math import comb, isqrt
%o A360573 from sympy import integer_nthroot
%o A360573 def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1), 3)[0])-(n<comb(m+2, 3))+2, 3)<<1))-((r<<2)<=(k<<2)*(k+1)+1)
%o A360573 def A333516(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
%o A360573 def A360010(n): return (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2, 3))
%o A360573 def A360573(n):
%o A360573     a = (a2:=integer_nthroot(24*n, 4)[0])+(n>comb(a2+2, 4))+3
%o A360573     j = comb(a-1,4)-n
%o A360573     b, c, d = A360010(j+1)+2, A056557(j)+2, A333516(j+1)
%o A360573     return (1<<a)-(1<<b)-(1<<c)-(1<<d)-1 # _Chai Wah Wu_, Dec 18 2024
%o A360573 (PARI) isok(m) = (m%2) && #select(x->(x==0), binary(m)) == 3; \\ _Michel Marcus_, Feb 13 2023
%Y A360573 Cf. A005408, A023416, A056557, A333516, A353654, A360010, A360574.
%Y A360573 Subsequences: A052996 \ {1,3,8}, A171389 \ {20}, A198276 \ {18}.
%Y A360573 Odd numbers with k zeros in their binary expansion: A000225 (k=0), A190620 (k=1), A357773 (k=2), this sequence (k=3).
%K A360573 nonn,base
%O A360573 1,1
%A A360573 _Bernard Schott_, Feb 12 2023