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.

A128174 Transform, (1,0,1,...) in every column.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Feb 17 2007

Keywords

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

Examples

			First few rows of the triangle are:
  1;
  0, 1;
  1, 0, 1;
  0, 1, 0, 1;
  1, 0, 1, 0, 1; ...
		

Crossrefs

Cf. A004526 (row sums).

Programs

  • 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
    
  • Magma
    [[(1+(-1)^(n-k))/2: k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jun 05 2019
    
  • 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 *)
  • PARI
    for(n=1,12, for(k=1,n, print1((1+(-1)^(n-k))/2, ", "))) \\ G. C. Greubel, Sep 26 2017
    
  • Sage
    [[(1+(-1)^(n-k))/2 for k in (1..n)] for n in (1..12)] # G. C. Greubel, 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