

A256797


Nonpositive part of the minimal alternating squares representation of n.


2



0, 2, 1, 0, 4, 4, 4, 1, 0, 10, 9, 4, 4, 4, 1, 0, 9, 11, 10, 9, 4, 4, 4, 1, 0, 20, 9, 9, 11, 10, 9, 4, 4, 4, 1, 0, 16, 20, 20, 9, 9, 11, 10, 9, 4, 4, 4, 1, 0, 18, 17, 16, 20, 20, 9, 9, 11, 10, 9, 4, 4, 4, 1, 0, 16, 16, 18, 17, 16, 20, 20, 9, 9, 11, 10, 9, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

See A256789 for definitions.


LINKS

Clark Kimberling, Table of n, a(n) for n = 1..1000


EXAMPLE

R(1) = 1, positive part 1, nonpositive part 0;
R(2) = 4  2, positive part 4, nonpositive part 2;
R(3) = 4  1, positive part 4, nonpositive part 1;
R(89) = 100  16 + 9  4, positive part 100 + 9 = 109, nonpositive part 16 + 4 = 20.


MATHEMATICA

b[n_] := n^2; bb = Table[b[n], {n, 0, 100}];
s[n_] := Table[b[n], {k, 1, 2 n  1}];
h[1] = {1}; h[n_] := Join[h[n  1], s[n]];
g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, 2};
r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[g[[n]]  n]]];
t = Table[r[n], {n, 1, z}] (* A256789 *)
Table[Total[(Abs[r[n]] + r[n])/2], {n, 1, 120}] (* A256796 *)
Table[Total[(Abs[r[n]]  r[n])/2], {n, 1, 120}] (* A256797 *)


CROSSREFS

Cf. A256789, A256796.
Sequence in context: A077908 A052922 A181930 * A109167 A066426 A100887
Adjacent sequences: A256794 A256795 A256796 * A256798 A256799 A256800


KEYWORD

nonn,easy


AUTHOR

Clark Kimberling, Apr 13 2015


STATUS

approved



