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”).
%I #4 Apr 13 2015 09:40:21
%S 1,2,4,4,9,8,8,8,17,18,20,16,17,16,16,16,33,34,36,36,41,40,40,32,33,
%T 34,36,32,33,32,32,32,65,66,68,68,73,72,72,72,81,82,84,80,81,80,80,64,
%U 65,66,68,68,73,72,72,64,65,66,68,64,65,64,64,64,129,130
%N Positive part of the minimal alternating binary representation of n (defined at A245596).
%H Clark Kimberling, <a href="/A256701/b256701.txt">Table of n, a(n) for n = 1..1000</a>
%F A256701(n) - A256702(n) = n.
%e R(1) = 1; positive part 1, nonpositive part 0
%e R(2) = 2; positive part 2, nonpositive part 0
%e R(3) = 4 - 1; positive part 4, nonpositive part 1
%e R(11) = 16 - 8 + 4 - 1; positive part 16+4 = 20; nonpositive part 8 + 1 = 9
%t b[n_] := 2^n; bb = Table[b[n], {n, 0, 40}];
%t s[n_] := Table[b[n + 1], {k, 1, b[n]}];
%t h[0] = {1}; h[n_] := Join[h[n - 1], s[n - 1]];
%t g = h[10]; Take[g, 100]; r[0] = {0};
%t r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
%t Table[Total[Abs[r[n]]], {n, 1, 100}] (* A073122 *)
%t u = Table[Total[(Abs[r[n]] + r[n])/2], {n, 1, 100}] (* A256701 *)
%t v = Table[Total[(Abs[r[n]] - r[n])/2], {n, 1, 100}] (* A256702 *)
%Y Cf. A245596, A073122, A256702.
%K nonn,easy
%O 1,2
%A _Clark Kimberling_, Apr 09 2015