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.

A122750 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.

This page as a plain text file.
%I A122750 #22 Aug 10 2025 00:46:11
%S A122750 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 A122750 -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 A122750 -2,1,-2,1,-2,1,-2,1,-2,1
%N A122750 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 A122750 The row sums of the absolute values are 1+n*(5+(-1)^n)/4 = 1+A080512(n). - _R. J. Mathar_, May 12 2013
%e A122750 Triangle begins:
%e A122750    1
%e A122750   -1,  1
%e A122750    1, -2,  1
%e A122750   -1,  1, -1,  1
%e A122750    1, -2,  1, -2,  1
%e A122750   -1,  1, -1,  1, -1,  1
%e A122750    1, -2,  1, -2,  1, -2,  1
%p A122750 A122750 := proc(n,k)
%p A122750     if type(n,'even') then
%p A122750         if type(k,'even') then
%p A122750             (-1)^k ;
%p A122750         else
%p A122750             2*(-1)^k ;
%p A122750         end if;
%p A122750     else
%p A122750         (-1)^(k+1) ;
%p A122750     end if;
%p A122750 end proc: # _R. J. Mathar_, May 12 2013
%t A122750 T[n_, k_] := If [Mod[n, 2] == 1, (-1)^(k + 1), (-1)^k*(1 + Mod[k, 2])]; a = Table[T[n, k], {n, 0, 10}, {k, 0, n}]; Flatten[a]
%t A122750 (* For the unsigned version: *) t[n_, m_] = 1 + Mod[n - m, 2]*Mod[m, 2]; a = Table[t[n, m], {n, 0, 10}, {m, 0, n}]; Flatten[a] (* _Roger L. Bagula_, Sep 06 2008 *)
%K A122750 sign,tabl,easy
%O A122750 0,5
%A A122750 _Roger L. Bagula_, Sep 21 2006, Sep 04 2008