%I #11 Mar 12 2014 16:36:58
%S 1,-1,1,1,-2,1,-1,1,-1,1,1,-2,1,-2,1,-1,1,-1,1,-1,1,1,-2,1,-2,1,-2,1,
%T -1,1,-1,1,-1,1,-1,1,1,-2,1,-2,1,-2,1,-2,1,-1,1,-1,1,-1,1,-1,1,-1,1,1,
%U -2,1,-2,1,-2,1,-2,1,-2,1
%N Triangle T(n,k) = (-1)^(k+1) if n is odd, = (-1)^k if n and k are even, = 2*(-1)^k if n is even and k is odd, 0<=k<=n.
%C Original definition: A pattern triangular array with three coefficient states:{-2,-1,1} Rules: States {1,-1} going to States{1,-2,1} States{1,-2} going to {1,-1,1} States{-2,1} going to {-1,1,-1}.
%C The unsigned version is given by T(n,k)= 1 + mod(n-k,2) *mod(k,2). - _Roger L. Bagula_, Sep 06 2008
%C The row sums of the absolulte values are 1, 2, 4, 4, 7, 6, 10, 8, 13, 10, 16, ... - _Roger L. Bagula_, Sep 06 2008
%C The row sums of the absolute values are 1+n*(5+(-1)^n)/4 = 1+A080512(n). - _R. J. Mathar_, May 12 2013
%e 1
%e -1, 1
%e 1, -2, 1
%e -1, 1, -1, 1
%e 1, -2, 1, -2, 1}
%e -1, 1,-1, 1, -1, 1
%e 1, -2, 1, -2, 1, -2, 1
%p A122750 := proc(n,k)
%p if type(n,'even') then
%p if type(k,'even') then
%p (-1)^k ;
%p else
%p 2*(-1)^k ;
%p end if;
%p else
%p (-1)^(k+1) ;
%p end if;
%p end proc: # _R. J. Mathar_, May 12 2013
%t T[n_, k_] := If [Mod[n, 2] == 1, (-1)^(k + 1), (-1)^k*(1 + Mod[k, 2])] a = Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}]; Flatten[a]
%t For the unsigned version: t[n_, m_] = 1 + Mod[n - m, 2]*Mod[m, 2]; Table[Table[t[n, m], {m, 0, n}], {n, 0, 10}]; Flatten[%] - _Roger L. Bagula_, Sep 06 2008
%K sign,tabl,easy
%O 0,5
%A _Roger L. Bagula_, Sep 21 2006, Sep 04 2008
|