Qual comando eu poderia usar para obter a tabela de valores?

Qual comando eu poderia usar para obter a tabela de valores?

Quero pegar a tabela de valores como no link a seguir:

Mesa

Eu escrevi a seguinte parte do código:

   \central
    \begin{tabular}{ | l | l | l | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | }
    \hline
    \foreignlanguage{english}{m} \setminus \foreignlanguage{english}{n} & 0 & 1 & 2 & 3 & 4 & 5  & \dots & \foreignlanguage{english}{y} \\ \hline
    0 & 1 & 2 & 3 & 4 & 5 & 6 & \dots & \foreignlanguage{english}{y}+1 \\ \hline 
    1 & 2 & 3 & 4 & 5 & 6 & 7  & \dots & \foreignlanguage{english}{y}+2 \\ \hline
    2 & 3 & 5 & 7 & 9 & 11 & 13  & \dots & 2\foreignlanguage{english}{y}+3 \\ \hline
    3 & 5 & 13 & 39 & 81 &  &  &    \dots & 8 \cdot 2^{\foreignlanguage{english}{y}}-3\\ \hline 
    4 & 13 & 65533 &  &  &  &  &   \dots &  2^{2^{.^{.^.}}^2}-3\\ \hline 
    5 & 65533 &  &  &  &  &  &  \dots  & \\ \hline 
    \dots &  &  &  &  &  &  &  \dots  &\\ \hline 
    \end{tabular} 

Está correto?? Posso melhorar alguma coisa??

Responder1

Aqui está como eu faria isso:

\documentclass{article}

\usepackage[margin = 3cm]{geometry}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{mathdots}

\begin{document}

\noindent Before.

\begin{table}[htbp]
\centering
 \label{table:something}
  \begin{tabular}{
         >{$}c<{$}
    *{2}{S[table-format = 5]}
    *{2}{S[table-format = 2]}
    *{2}{S[table-format = 3]}
  }
   \toprule
    A(m,n) & {$n = 0$} & {$n = 1$} & {$n = 2$}             & {$n = 3$}                 & {$n = 4$}                     & {$n = 5$}                         \\
   \midrule 
    m = 0  &     1     &     2     &  3                    &  4                        &   5                           &   6                               \\[1ex]
    m = 1  &     2     &     3     &  4                    &  5                        &   6                           &   7                               \\[1ex]
    m = 2  &     3     &     5     &  7                    &  9                        &  11                           &  13                               \\[1ex]
    m = 3  &     5     &    13     & 29                    & 61                        & 125                           & 253                               \\[1ex]
    m = 4  &    13     & 65536     & {$2^{\num{65536}}-3$} & {$2^{2^{\num{65536}}}-3$} & {$2^{2^{2^{\num{65536}}}}-3$} & {$2^{2^{2^{2^{\num{65536}}}}}-3$} \\[1ex]
    m = 5  & 65536     &           &                       &                           &                               &                                   \\[1ex]
    m = 6  & {$2^{2^{2^{2^{\iddots}}}}\raisebox{1.2ex}{$\Bigr\}$\,(\num{65536}~mal)}-3$} & & & & &                                                          \\
   \bottomrule
  \end{tabular}
\end{table}

\noindent After.

\end{document}

saída

Algumas sugestões:

  • Use osiunitxpacote para alinhar os números na tabela. (Além disso, use o pacote se você tiver unidades físicas.)
  • Use obooktabspacote para obter uma melhor espessura - e espaçamento - das réguas horizontais.
  • Use a sintaxe *{<number of columns>}{<column type>}sempre que possível para encurtar o código.
  • Estruture o código de entrada para que se pareça com a saída para obter uma melhor visão geral dele.

PS Se você quiser uma legenda para a tabela, use ocaptionpacote com opção tableposition = topde obter melhor espaçamento entre a legenda e a tabela.

informação relacionada