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.

A014781 Seidel's triangle, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 3, 3, 8, 6, 3, 8, 14, 17, 17, 56, 48, 34, 17, 56, 104, 138, 155, 155, 608, 552, 448, 310, 155, 608, 1160, 1608, 1918, 2073, 2073, 9440, 8832, 7672, 6064, 4146, 2073, 9440, 18272, 25944, 32008, 36154, 38227
Offset: 1

Views

Author

Keywords

Comments

Named after the German mathematician Philipp Ludwig von Seidel (1821-1896). - Amiram Eldar, Jun 13 2021

Examples

			Triangle begins:
     1;
     1;
     1,    1;
     2,    1;
     2,    3,    3;
     8,    6,    3;
     8,   14,   17,   17;
    56,   48,   34,   17;
    56,  104,  138,  155,  155;
   608,  552,  448,  310,  155;
   608, 1160, 1608, 1918, 2073, 2073;
  9440, 8832, 7672, 6064, 4146, 2073;
  ...
		

Crossrefs

Even terms of first column give A005439. Diagonal gives A001469.

Programs

  • Mathematica
    max = 13; T[1, 1] = 1; T[n_, k_] /; 1 <= k <= (n+1)/2 := T[n, k] = If[EvenQ[n], Sum[T[n-1, i], {i, k, max}], Sum[T[n-1, i], {i, 1, k}]]; T[, ] = 0; Table[T[n, k], {n, 1, max}, {k, 1, (n+1)/2}] // Flatten (* Jean-François Alcover, Nov 18 2016 *)
  • SageMath
    # Algorithm of L. Seidel (1877)
    # n -> Prints first n rows of the triangle
    def A014781_triangle(n) :
        D = []; [D.append(0) for i in (0..n)]; D[1] = 1
        b = True
        for i in(0..n) :
            h = (i-1)//2 + 1
            if b :
                for k in range(h-1,0,-1) : D[k] += D[k+1]
            else :
                for k in range(1,h+1,1) :  D[k] += D[k-1]
            b = not b
            if i>0 : print([D[z] for z in (1..h)])
    A014781_triangle(12) # Peter Luschny, Apr 01 2012

Extensions

More terms from Mike Domaratzki (mdomaratzki(AT)alumni.uwaterloo.ca), Nov 18 2001