login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A256797 Nonpositive part of the minimal alternating squares representation of n. 2

%I #11 May 14 2017 11:51:48

%S 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,

%T 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,

%U 4,4,4,1,0,16,16,18,17,16,20,20,9,9,11,10,9,4

%N Nonpositive part of the minimal alternating squares representation of n.

%C See A256789 for definitions.

%H Clark Kimberling, <a href="/A256797/b256797.txt">Table of n, a(n) for n = 1..1000</a>

%e R(1) = 1, positive part 1, nonpositive part 0;

%e R(2) = 4 - 2, positive part 4, nonpositive part 2;

%e R(3) = 4 - 1, positive part 4, nonpositive part 1;

%e R(89) = 100 - 16 + 9 - 4, positive part 100 + 9 = 109, nonpositive part 16 + 4 = 20.

%t b[n_] := n^2; bb = Table[b[n], {n, 0, 100}];

%t s[n_] := Table[b[n], {k, 1, 2 n - 1}];

%t h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];

%t g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};

%t r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];

%t t = Table[r[n], {n, 1, z}] (* A256789 *)

%t Table[Total[(Abs[r[n]] + r[n])/2], {n, 1, 120}] (* A256796 *)

%t Table[Total[(Abs[r[n]] - r[n])/2], {n, 1, 120}] (* A256797 *)

%Y Cf. A256789, A256796.

%K nonn,easy

%O 1,2

%A _Clark Kimberling_, Apr 13 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)