cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A256796 Positive part of the minimal alternating squares representation of n.

This page as a plain text file.
%I A256796 #14 May 14 2017 11:51:37
%S A256796 1,4,4,4,9,10,11,9,9,20,20,16,17,18,16,16,26,29,29,29,25,26,27,25,25,
%T A256796 46,36,37,40,40,40,36,37,38,36,36,53,58,59,49,50,53,53,53,49,50,51,49,
%U A256796 49,68,68,68,73,74,64,65,68,68,68,64,65,66,64,64,81,82
%N A256796 Positive part of the minimal alternating squares representation of n.
%C A256796 See A256789 for definitions.
%H A256796 Clark Kimberling, <a href="/A256796/b256796.txt">Table of n, a(n) for n = 1..1000</a>
%e A256796 R(1) = 1, positive part 1, nonpositive part 0;
%e A256796 R(2) = 4 - 2, positive part 4, nonpositive part 2;
%e A256796 R(3) = 4 - 1, positive part 4, nonpositive part 1;
%e A256796 R(89) = 100 - 16 + 9 - 4, positive part 100 + 9 = 109, nonpositive part 16 + 4 = 20.
%t A256796 b[n_] := n^2; bb = Table[b[n], {n, 0, 100}];
%t A256796 s[n_] := Table[b[n], {k, 1, 2 n - 1}];
%t A256796 h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];
%t A256796 g = h[100]; r[0] = {0}; r[1] = {1}; r[2] = {4, -2};
%t A256796 r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, -r[g[[n]] - n]]];
%t A256796 t = Table[r[n], {n, 1, z}] (* A256789 *)
%t A256796 Table[Total[(Abs[r[n]] + r[n])/2], {n, 1, 120}]  (* A256796 *)
%t A256796 Table[Total[(Abs[r[n]] - r[n])/2], {n, 1, 120}]  (* A256797 *)
%Y A256796 Cf. A256789, A256797.
%K A256796 nonn,easy
%O A256796 1,2
%A A256796 _Clark Kimberling_, Apr 13 2015