Is there a way with MathJaX (on math.stackexchange.com) of displaying, say, Pascal's Triangle or some similar triangular stack of numbers, such as the Stirling Numbers of the First Kind, without resorting to array or matrix tricks to do it? I can't directly demonstrate what I tried, because MathJaX doesn't work on this forum, but I've posted a comment on math.stackexchange.com in which I tried to do it with code similar to this:
$$\begin{matrix}
&&&&&1\\
&&&&1&&1\\
&&&1&&3&&2\\
&&1&&6&&11&&6\\
&1&&10&&35&&50&&24\\
1&&15&&85&&225&&274&&120
\end{matrix}$$
which renders like this:
As you can see, the bigger the numbers get, the farther apart they are spaced, and so far the table is already beginning to look a little asymmetric! I've had better success with HTML tables, but table
tags and their helpers aren't permitted on StackExchange sites. Is there a better way to do this on your Math forums? Is this even the right community for this question?
Edit: Here is a screenshot showing the lower right corner of the HTML table, so you can get a feel for the look I want:
Update: After trying several different approaches, I think I may have found a (fairly) workable solution, although it still has its difficulties: $$\newcommand\cn[2]{\llap{#1}\rlap{#2}\,} \begin{array}{c} &&&&&&\cn{1}{}\\ &&&&&\cn{1}{}&\cn{}{}&\cn{1}{}\\ &&&&\cn{1}{}&\cn{}{}&\cn{3}{}&\cn{}{}&\cn{2}{}\\ &&&\cn{1}{}&\cn{}{}&\cn{6}{}&\cn{}{}&\cn{1}{1}&\cn{}{}&\cn{6}{}\\ &&\cn{1}{}&\cn{}{}&\cn{1}{0}&\cn{}{}&\cn{3}{5}&\cn{}{}&\cn{5}{0}&\cn{}{}&\cn{2}{4}\\ &\cn{1}{}&\cn{}{}&\cn{1}{5}&\cn{}{}&\cn{8}{5}&\cn{}{}&\cn{22}{5}&\cn{}{}&\cn{27}{4}&\cn{}{}&\cn{12}{0}\\ \cn{1}{}&\cn{}{}&\cn{2}{1}&\cn{}{}&\cn{17}{5}&\cn{}{}&\cn{73}{5}&\cn{}{}&\cn{16}{24}&\cn{}{}&\cn{17}{64}&\cn{}{}&\cn{72}{0} \end{array}$$ The code is:
$$\newcommand\cn[2]{\llap{#1}\rlap{#2}\,}
\begin{array}{c}
&&&&&&\cn{1}{}\\
&&&&&\cn{1}{}&\cn{}{}&\cn{1}{}\\
&&&&\cn{1}{}&\cn{}{}&\cn{3}{}&\cn{}{}&\cn{2}{}\\
&&&\cn{1}{}&\cn{}{}&\cn{6}{}&\cn{}{}&\cn{1}{1}&\cn{}{}&\cn{6}{}\\
&&\cn{1}{}&\cn{}{}&\cn{1}{0}&\cn{}{}&\cn{3}{5}&\cn{}{}&\cn{5}{0}&\cn{}{}&\cn{2}{4}\\
&\cn{1}{}&\cn{}{}&\cn{1}{5}&\cn{}{}&\cn{8}{5}&\cn{}{}&\cn{22}{5}&\cn{}{}&\cn{27}{4}&\cn{}{}&\cn{12}{0}\\
\cn{1}{}&\cn{}{}&\cn{2}{1}&\cn{}{}&\cn{17}{5}&\cn{}{}&\cn{73}{5}&\cn{}{}&\cn{16}{24}&\cn{}{}&\cn{17}{64}&\cn{}{}&\cn{72}{0}
\end{array}$$
I used array
instead of matrix
, and I split each cell into two halves: the left side of each number goes to \llap
and the right side goes to rlap
. And because it's an array
, the table expands to fit the data. The numbers are (sort of) centered now--at least, more so than with a single left or right alignment.
\begin{tabular}...\end{tabular}
is currently supported by MathJaX. Maybe I could load it. What's the extension name? $\endgroup$\hspace
to cancel center width: $$\newcommand\scollapse[2]{\hspace{-#1pt}#2\hspace{-#1pt}} \newcommand\cn[3]{\scollapse{1.5}{\llap{#1}#2\rlap{#3}}} \begin{array}{c} &&&&&&\cn{}{1}{}\\ &&&&&\cn{}{1}{}&&\cn{}{1}{}\\ &&&&\cn{}{1}{}&&\cn{}{3}{}&&\cn{}{2}{}\\ &&&\cn{}{1}{}&&\cn{}{6}{}&&\cn{1}{}{1}&&\cn{}{6}{}\\ &&\cn{}{1}{}&&\cn{1}{}{0}&&\cn{3}{}{5}&&\cn{5}{}{0}&&\cn{2}{}{4}\\ &\cn{}{1}{}&&\cn{1}{}{5}&&\cn{8}{}{5}&&\cn{2}{2}{5}&&\cn{2}{7}{4}&&\cn{1}{2}{0}\\ \cn{}{1}{}&&\cn{2}{}{1}&&\cn{1}{7}{5}&&\cn{7}{3}{5}&&\cn{16}{}{24}&&\cn{17}{}{64}&&\cn{7}{2}{0} \end{array}$$ $\endgroup$