OFFSET
1,3
COMMENTS
If m is a term with m mod 4 < 2 then is also m+2 a term;
0 <= a(2*n-1) mod 4 <= 1 and 2 <= a(2*n) mod 4 <= 3;
a(n) mod 2 = 1 - a(floor((n-1)/2)) mod 2;
a(n) mod 4 = a(n) mod 2 + 2*(1 - n mod 2);
floor(a(n)/4) = a(floor((n-1)/2));
in binary representation there are no runs of more than 3 zeros or 3 ones: subsequence of A166535.
LINKS
R. Zumkeller, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Quaternary
FORMULA
Let m = a(floor((n-1)/2)), then for n > 3:
a(n) = 4*m - m mod 2 + 1 + 2*(1 - n mod 2).
EXAMPLE
a(10)=14->base4:32->base2:1110;
a(100)=1126->base4:101212->base2:10001100110;
a(1000)=113043->base4:123212103->base2:11011100110010011.
MATHEMATICA
Select[Range[0, 500], And@@OddQ[Total/@Partition[IntegerDigits[#, 4], 2, 1]]&] (* Harvey P. Dale, Aug 19 2012 *)
CROSSREFS
KEYWORD
base,nonn,easy
AUTHOR
Reinhard Zumkeller, Aug 04 2010
STATUS
approved