A173589 Integers whose binary representation contains exactly three 1's, no two 1's being adjacent.
21, 37, 41, 42, 69, 73, 74, 81, 82, 84, 133, 137, 138, 145, 146, 148, 161, 162, 164, 168, 261, 265, 266, 273, 274, 276, 289, 290, 292, 296, 321, 322, 324, 328, 336, 517, 521, 522, 529, 530, 532, 545, 546, 548, 552, 577, 578, 580, 584, 592, 641, 642, 644, 648
Offset: 1
Examples
a(1) = 21 = 10101_2. a(2) = 37 = 100101_2. a(3) = 41 = 101001_2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
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
-
Mathematica
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 *)
-
Python
from math import isqrt, comb from sympy import integer_nthroot 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<
Chai Wah Wu, Apr 07 2025
Extensions
More terms from R. J. Mathar, Feb 24 2010
Comments