A154325 Triangle with interior all 2's and borders 1.
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
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)
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
Comments