login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A143221
a(0)=1. For n >=1, a(n) = 0 if the binary representation of n occurs at least once in the concatenation of (a(0),a(1),...,a(n-1)). a(n) = 1 otherwise.
3
1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1
OFFSET
0,1
LINKS
EXAMPLE
The binary representation of 21 is 10101. This occurs in the concatenation of terms a(0) through a(20) like so: 10010111(10101)00010010. So a(21) = 0.
MAPLE
S:= "1":
for n from 1 to 1000 do
if StringTools:-Search(convert(convert(n, binary), string), S) = 0 then S:= cat(S, "1") else S:= cat(S, "0") fi
od:
map(parse, StringTools:-Explode(S)); # Robert Israel, May 06 2018
MATHEMATICA
f[l_List]:=Append[l, Boole[StringPosition[ToString[FromDigits[l]], ToString[FromDigits[IntegerDigits[Length[l], 2]]]]=={}]]; Nest[f, {1}, 125] (* Ray Chandler, Nov 09 2008 *)
CROSSREFS
Sequence in context: A104105 A295889 A347523 * A325899 A126999 A306862
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 30 2008
EXTENSIONS
Extended by Ray Chandler, Nov 09 2008
STATUS
approved