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.

A154325 Triangle with interior all 2's and borders 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
Offset: 0

Views

Author

Paul Barry, Jan 07 2009

Keywords

Comments

This triangle follows a general construction method as follows: Let a(n) be an integer sequence with a(0)=1, a(1)=1. Then T(n,k,r):=[k<=n](1+r*a(k)*a(n-k)) defines a symmetrical triangle.
Row sums are n + 1 + r*Sum_{k=0..n} a(k)*a(n-k) and central coefficients are 1+r*a(n)^2.
Here a(n)=1-0^n and r=1. Row sums are A004277.
Eigensequence of the triangle = A000129, the Pell sequence. - Gary W. Adamson, Feb 12 2009
Inverse has general element T(n,k)*(-1)^(n-k). - Paul Barry, Oct 06 2010

Examples

			Triangle begins
  1;
  1, 1;
  1, 2, 1;
  1, 2, 2, 1;
  1, 2, 2, 2, 1;
  1, 2, 2, 2, 2, 1;
  1, 2, 2, 2, 2, 2, 1;
From _Paul Barry_, Oct 06 2010: (Start)
Production matrix is
  1,  1;
  0,  1, 1;
  0, -1, 0, 1;
  0,  1, 0, 0, 1;
  0, -1, 0, 0, 0, 1;
  0,  1, 0, 0, 0, 0, 1;
  0, -1, 0, 0, 0, 0, 0, 1;
  0,  1, 0, 0, 0, 0, 0, 0, 1; (End)
		

Crossrefs

Programs

  • Mathematica
    a[n_] :=
     If[Length@
        NestWhileList[# -
           Floor[(Sqrt[8 # + 1] - 1)/2] (Floor[(Sqrt[8 # + 1] - 1)/2] + 1)/
    2 &, n, # > 1 &] <= 2, 1, 2] (* David Naccache, Jul 13 2025 *)
  • PARI
    row(n) = vector(n+1, k, k--; (2-0^(k*(n-k)))); \\ Michel Marcus, Jul 13 2025

Formula

Number triangle T(n,k) = [k<=n](2-0^(n-k)-0^k+0^(n+k)) = [k<=n](2-0^(k*(n-k))).
a(n) = 2 - A103451(n). - Omar E. Pol, Jan 18 2009

Extensions

More terms from Michel Marcus, Jul 13 2025