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.
%I A173589 #15 Apr 07 2025 10:22:57 %S A173589 21,37,41,42,69,73,74,81,82,84,133,137,138,145,146,148,161,162,164, %T A173589 168,261,265,266,273,274,276,289,290,292,296,321,322,324,328,336,517, %U A173589 521,522,529,530,532,545,546,548,552,577,578,580,584,592,641,642,644,648 %N A173589 Integers whose binary representation contains exactly three 1's, no two 1's being adjacent. %C A173589 Subsequence of A014311. [_R. J. Mathar_, Feb 24 2010] %C A173589 A000120(a(n))=3; A023416(a(n))>1; 1 < A087116(a(n))<=3. [_Reinhard Zumkeller_, Mar 11 2010] %H A173589 Robert Israel, <a href="/A173589/b173589.txt">Table of n, a(n) for n = 1..10000</a> %e A173589 a(1) = 21 = 10101_2. %e A173589 a(2) = 37 = 100101_2. %e A173589 a(3) = 41 = 101001_2. %p A173589 seq(seq(seq(2^a+2^b+2^c, c=0..b-2),b=2..a-2),a=4..10); # _Robert Israel_, Dec 19 2016 %t A173589 e31sQ[n_]:=Module[{idn2=IntegerDigits[n,2]},Total[idn2]==3 && SequenceCount[ idn2,{1,1}]==0]; Select[Range[700],e31sQ] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Sep 20 2018 *) %o A173589 (Python) %o A173589 from math import isqrt, comb %o A173589 from sympy import integer_nthroot %o A173589 def A173589(n): return (1<<(r:=n-1-comb((m:=integer_nthroot(6*n,3)[0])+(t:=(n>comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2))+(1<<(a:=isqrt(s:=n-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1)+1)+(1<<m+t+3) # _Chai Wah Wu_, Apr 07 2025 %Y A173589 Cf. A000120, A014311, A023416, A087116. %K A173589 base,nonn %O A173589 1,1 %A A173589 David Koslicki (koslicki(AT)math.psu.edu), Feb 22 2010 %E A173589 More terms from _R. J. Mathar_, Feb 24 2010