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 A099966 #19 Aug 03 2021 19:05:00 %S A099966 1,1,3,6,14,39,109,313,900,2943,10403,36195,127474,447352,1711141, %T A099966 7234223,29672119,123515469,511672779,2123410053,9349845765, %U A099966 45883313142,216991244323,1041956760633,4977352149113,23819499579914 %N A099966 Sequence of the next-to-last entries in the rows of A099964. %H A099966 Reinhard Zumkeller, <a href="/A099966/b099966.txt">Table of n, a(n) for n = 1..750</a> %p A099966 with(linalg):rev:=proc(a) local n, p; n:=vectdim(a): p:=i->a[n+1-i]: vector(n,p) end: ps:=proc(a) local n, q; n:=vectdim(a): q:=i->sum(a[j],j=1..i): vector(n,q) end: pss:=proc(a) local n, q; n:=vectdim(a): q:=proc(i) if i<=n then sum(a[j],j=1..i) else sum(a[j],j=1..n) fi end: vector(n+1,q) end: tr:={seq(n*(n+1)/2,n=1..30)}: R[0]:=vector(1,1): for n from 1 to 30 do if member(n,tr)=false then R[n]:=ps(rev(R[n-1])) else R[n]:=pss(rev(R[n-1])) fi od: seq(R[n][vectdim(R[n])-1],n=1..30); # _Emeric Deutsch_, Nov 16 2004 %t A099966 triQ[n_] := Module[{k}, Reduce[n == k (k + 1)/2, k, Integers] =!= False]; %t A099966 row[0] = {1}; row[1] = {1, 1}; row[n_] := row[n] = (ro = Accumulate[ Reverse[ row[n - 1]]]; If[triQ[n], Append[ro, Last[ro]], ro]); a[n_] := row[n][[-2]]; Array[a, 26] (* _Jean-François Alcover_, Feb 13 2018 *) %o A099966 (Haskell) %o A099966 a099966 n = a099966_list !! (n-1) %o A099966 a099966_list = map (last . init) $ tail a099964_tabf %o A099966 -- _Reinhard Zumkeller_, May 02 2012 %Y A099966 Cf. A099964, A099965. %K A099966 nonn,easy %O A099966 1,3 %A A099966 _N. J. A. Sloane_, Nov 13 2004 %E A099966 More terms from _Emeric Deutsch_, Nov 16 2004 %E A099966 Offset corrected by _Reinhard Zumkeller_, May 02 2012