(Translated by https://www.hiragana.jp/)
A128174 - OEIS
login
A128174
Transform, (1,0,1,...) in every column.
60
1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
OFFSET
1,1
COMMENTS
Inverse of the triangle = a tridiagonal matrix with (1,1,1,...) in the superdiagonal, (0,0,0,...) in the main diagonal and (-1,-1,-1,...) in the subdiagonal.
Riordan array (1/(1-x^2), x) with inverse (1-x^2,x). - Paul Barry, Sep 10 2008
The position of 1's in this sequence is equivalent to A246705, and the position of 0's is equivalent to A246706. - Bernard Schott, Jun 05 2019
FORMULA
A lower triangular matrix transform, (1, 0, 1, ...) in every column; n terms of (1, 0, 1, ...) in odd rows; n terms of (0, 1, 0, ...) in even rows.
T(n,k) = [k<=n]*(1+(-1)^(n-k))/2. - Paul Barry, Sep 10 2008
With offset n=1, k=0: Sum_{k=0..n} {T(n,k)*x^k} = A000035(n), A004526(n+1), A000975(n), A033113(n), A033114(n), A033115(n), A033116(n), A033117(n), A033118(n), A033119(n), A056830(n+1) for x=0,1,2,3,4,5,6,7,8,9,10 respectively. - Philippe Deléham, Oct 17 2011
T(n+1,1) = 1 - T(n,1); T(n+1,k) = T(n,k-1), 1 < k <= n+1. - Reinhard Zumkeller, Aug 01 2014
EXAMPLE
First few rows of the triangle are:
1;
0, 1;
1, 0, 1;
0, 1, 0, 1;
1, 0, 1, 0, 1; ...
MAPLE
A128174 := proc(n, k)
if k > n or k < 1 then
0;
else
modp(k+n+1, 2) ;
end if;
end proc: # R. J. Mathar, Aug 06 2016
MATHEMATICA
a128174[r_] := Table[If[EvenQ[n+k], 1, 0], {n, 1, r}, {k, 1, n}]
TableForm[a128174[5]] (* triangle *)
Flatten[a128174[10]] (* data *) (* Hartmut F. W. Hoft, Mar 15 2017 *)
Table[(1+(-1)^(n-k))/2, {n, 1, 12}, {k, 1, n}]//Flatten (* G. C. Greubel, Sep 26 2017 *)
PROG
(Haskell)
a128174 n k = a128174_tabl !! (n-1) !! (k-1)
a128174_row n = a128174_tabl !! (n-1)
a128174_tabl = iterate (\xs@(x:_) -> (1 - x) : xs) [1]
-- Reinhard Zumkeller, Aug 01 2014
(PARI) for(n=1, 12, for(k=1, n, print1((1+(-1)^(n-k))/2, ", "))) \\ G. C. Greubel, Sep 26 2017
(Magma) [[(1+(-1)^(n-k))/2: k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jun 05 2019
(Sage) [[(1+(-1)^(n-k))/2 for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jun 05 2019
CROSSREFS
Cf. A004526 (row sums).
Sequence in context: A286990 A249866 A369736 * A096055 A260456 A125144
KEYWORD
nonn,easy,tabl
AUTHOR
Gary W. Adamson, Feb 17 2007
STATUS
approved