OFFSET
1,2
COMMENTS
Apparently this means: take the run lengths of the 1's, then the run lengths of the 0's in the binary representation of n (scanned MSB to LSB), concatenate both lists and interpret the long list as a list of run length of alternatingly 1's and 0's. Example: n = 9 = 8+1 is 1001 in binary. Run lengths of 1's are 11 (two runs each of length 1). Run lengths of 0's are 2 (one run of length 2). The concatenation is 112, which is interpreted as 1 one, 1 zero, 2 ones, binary 1011, and recoded to decimal as a(9) = 8+2+1=11. [R. J. Mathar, Dec 07 2010]
MATHEMATICA
takelist[l_, t_] := Module[{lent, term}, Set[lent, Length[t]]; Table[l[[t[[y]]]], {y, 1, lent}]]
frombinrep[x_] := FromDigits[Flatten[Table[Table[If[OddQ[n], 1, 0], {d, 1, x[[n]]}], {n, 1, Length[x]}]], 2]
binrep[x_] := repcount[IntegerDigits[x, 2]]
onebinrep[x_]:=Module[{b}, b=binrep[x]; takelist[b, Range[1, Length[b], 2]]]
zerobinrep[x_]:=Module[{b}, b=binrep[x]; takelist[b, Range[2, Length[b], 2]]]
Table[frombinrep[Flatten[{onebinrep[n], zerobinrep[n]}]], {n, START, END}]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Dylan Hamilton, Oct 28 2010
STATUS
approved