OFFSET
1,2
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
EXAMPLE
R(1) = 1; positive part 1, nonpositive part 0
R(2) = 2; positive part 2, nonpositive part 0
R(3) = 4 - 1; positive part 4, nonpositive part 1
R(11) = 16 - 8 + 4 - 1; positive part 16+4 = 20; nonpositive part 8 + 1 = 9
MATHEMATICA
b[n_] := 2^n; bb = Table[b[n], {n, 0, 40}];
s[n_] := Table[b[n + 1], {k, 1, b[n]}];
h[0] = {1}; h[n_] := Join[h[n - 1], s[n - 1]];
g = h[10]; Take[g, 100]; r[0] = {0};
r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]]
Table[Total[Abs[r[n]]], {n, 1, 100}] (* A073122 *)
u = Table[Total[(Abs[r[n]] + r[n])/2], {n, 1, 100}] (* A256701 *)
v = Table[Total[(Abs[r[n]] - r[n])/2], {n, 1, 100}] (* A256702 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Apr 09 2015
STATUS
approved