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.
%I A131821 #25 Nov 07 2024 15:23:34 %S A131821 1,2,2,3,1,3,4,1,1,4,5,1,1,1,5,6,1,1,1,1,6,7,1,1,1,1,1,7,8,1,1,1,1,1, %T A131821 1,8,9,1,1,1,1,1,1,1,9,10,1,1,1,1,1,1,1,1,10,11,1,1,1,1,1,1,1,1,1,11, %U A131821 12,1,1,1,1,1,1,1,1,1,1,12,13,1,1,1,1,1,1,1,1,1,1,1,13,14,1,1,1,1,1,1,1,1,1,1,1,1,14 %N A131821 Triangle read by rows: row n consists of n followed by (n-2) ones then n. %F A131821 T(n,k) = A130296(n,k) + A051340(k-1,n-k) - 1. %F A131821 T(n,1) = T(n,n) = n for n >= 1, and T(n,k) = 1 for 2 <= k <= n - 1, n >= 3. %F A131821 From _Franck Maminirina Ramaharo_, Dec 19 2018: (Start) %F A131821 T(n,k) = A130296(n,k) + A130296(n,n-k+1) - 1. %F A131821 G.f.: y*(x - 3*x^2*y^2 + (x^2 + x^3)*y^3)/((1 - y)^2*(1 - x*y)^2). %F A131821 E.g.f.: (1 - x^2 +(x^2 + (x - x^2)*y)*exp(y) - (1 - (x - x^2)*y)*exp(x*y))/(1 - x). (End) %e A131821 First few rows of the triangle are: %e A131821 1; %e A131821 2, 2; %e A131821 3, 1, 3; %e A131821 4, 1, 1, 4; %e A131821 5, 1, 1, 1, 5; %e A131821 6, 1, 1, 1, 1, 6; %e A131821 7, 1, 1, 1, 1, 1, 7; %e A131821 ... %p A131821 A131821 := proc(n,c) if c=1 or c=n then n ; else 1 ; fi ; end: for n from 1 to 16 do for c from 1 to n do printf("%d,",A131821(n,c)) ; od: od: # _R. J. Mathar_, May 30 2008 %t A131821 T[n_, k_] := If[k == 1 || k == n, n, 1]; %t A131821 Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, May 05 2023 *) %o A131821 (Maxima) T(n,k) := if k = 1 or k = n then n else 1$ %o A131821 create_list(T(n, k), n, 1, 12, k, 1, n); /* _Franck Maminirina Ramaharo_, Dec 19 2018 */ %o A131821 (Python) %o A131821 from math import isqrt %o A131821 def A131821(n): return m+(k>r) if 0<=(k:=n<<1)-(r:=(m:=isqrt(k))*(m+1))<=2 or n<=2 else 1 # _Chai Wah Wu_, Nov 07 2024 %Y A131821 Row sums: A016777. %Y A131821 Cf. A130296, A051340, A016777, A131830. %K A131821 nonn,tabl,easy %O A131821 1,2 %A A131821 _Gary W. Adamson_, Jul 19 2007 %E A131821 More terms from _R. J. Mathar_, May 30 2008