OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1)=3 because bin(3)= 11.
MAPLE
filter:= proc(n) local L;
L:= convert(n, base, 2);
L:= L[1..-2]+L[2..-1];
has(L, 2) and not has(L, 0)
end proc:
select(filter, [$3..300]); # Robert Israel, Jun 17 2020
MATHEMATICA
fQ[n_] := Block[{st = Union@ Split@ IntegerDigits[n, 2]}, MemberQ[st, {1, __}] && !MemberQ[st, {0, __}]]; Select[Range@218, fQ@# &] (* Robert G. Wilson v, Dec 21 2008 *)
Select[Range[300], SequenceCount[IntegerDigits[#, 2], {0, 0}]== 0 && SequenceCount[ IntegerDigits[#, 2], {1, 1}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 11 2017 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Gil Broussard, Dec 17 2008
EXTENSIONS
Extended by Robert G. Wilson v, Dec 21 2008
STATUS
approved