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.

A049800 Triangular array T, read by rows: T(n,k) = (n+1) mod floor((k+1)/2), k = 1..n and n >= 1.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 2, 2, 0, 0, 0, 1, 1, 2, 2, 3, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 2, 2, 0
Offset: 1

Views

Author

Keywords

Examples

			Array T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  0;
  0, 0;
  0, 0, 0;
  0, 0, 1, 1;
  0, 0, 0, 0, 0;
  0, 0, 1, 1, 1, 1;
  0, 0, 0, 0, 2, 2, 0;
  0, 0, 1, 1, 0, 0, 1, 1;
  0, 0, 0, 0, 1, 1, 2, 2, 0;
  0, 0, 1, 1, 2, 2, 3, 3, 1, 1;
  0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0;
  ...
		

Crossrefs

One-half the row sums are in A049798.

Programs

  • GAP
    Flat(List([1..15], n-> List([1..n], k-> (n+1) mod Int((k+1)/2) ))); # G. C. Greubel, Dec 09 2019
  • Magma
    [ (n+1) mod Floor((k+1)/2): k in [1..n], n in [1..15]]; // G. C. Greubel, Dec 09 2019
    
  • Maple
    # To get the sequence:
    seq(seq((n+1) mod floor((k+1)/2), k = 1..n), n = 1..30);
    # To get the triangular array:
    for n from 1 to 30 do
        seq((n+1) mod floor((k+1)/2), k = 1..n);
    end do; # Petros Hadjicostas, Nov 20 2019
  • Mathematica
    Table[Mod[n+1, Floor[(k+1)/2]], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Dec 09 2019 *)
  • PARI
    T(n,k) = lift(Mod(n+1,(k+1)\2));
    for(n=1, 15, for(k=1, n, print1(T(n,k), ", "))) \\ G. C. Greubel, Dec 09 2019
    
  • Sage
    [[ mod(n+1, floor((k+1)/2)) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Dec 09 2019
    

Extensions

Name edited by Petros Hadjicostas, Nov 20 2019