login
A173021
Number of numbers <= n whose binary representation is without isolated ones or isolated double ones.
6
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
OFFSET
0,8
LINKS
FORMULA
a(A173024(n+1)) = a(A173024(n)) + 1.
a(2^n - 1) = A005252(n+1).
a(n) <= A173022(n) <= A173023(n).
EXAMPLE
a(30) = #{0, 7, 14, 15, 28, 30} = #{0, 111, 1110, 1111, 11100, 11110} = 6.
MATHEMATICA
ioQ[n_]:=Module[{idn2=Split[IntegerDigits[n, 2]]}, FreeQ[idn2, {1}]&&FreeQ[ idn2, {1, 1}]]; Accumulate[Table[If[ioQ[n], 1, 0], {n, 0, 90}]] (* Harvey P. Dale, May 15 2016 *)
CROSSREFS
KEYWORD
base,nonn,look
AUTHOR
Reinhard Zumkeller, Feb 07 2010
STATUS
approved