I made the following a while ago for multiplication (FYI it's in mod 7)

\documentclass{article}
\usepackage{tikz}
\usepackage{aligned-overset}
\begin{document}
\usetikzlibrary{matrix,fit}
\[
\begin{tikzpicture}[baseline=(M.center)]
\matrix (M) [
matrix of math nodes,
nodes={minimum width=1.5em, minimum height=1.5em, inner sep=0pt, outer sep=0pt},
column sep=0.1em, row sep=0em
]{
% Row 1: multiplicand (9 digits) placed in cols 4–12
{} & {} & {} &
2 & 3 & 4 & 2 & 3 & 4 & 6 & 3 & 6 \\
% Row 2: × and multiplier (10 digits) in cols 3–12
{} & {} & \times &
3 & 4 & 0 & 6 & 5 & 3 & 5 & 6 & 2 \\
% Row 4: first partial with embedded carries
{} & {} & {} &
\overset{\scriptscriptstyle1}{5} &
\overset{\scriptscriptstyle1}{0} &
\overset{}{1} &
\overset{\scriptscriptstyle1}{5} &
\overset{\scriptscriptstyle1}{0} &
\overset{\scriptscriptstyle1}{2} &
\overset{\scriptscriptstyle1}{6} &
\overset{\scriptscriptstyle1}{0} &
\overset{}{5} \\
% Row 4: first partial with embedded carries
{} & {} & {} &
&
&
&
&
&
\ldots &
\overset{\scriptscriptstyle 5}{0} &
\overset{}{1} &
{} \\
{} & {} & {} &
&
&
&
&
&
&
\vdots &
&
{}\\
};
% horizontal rule under
\draw[line width=0.4pt]
(M-2-3.south west) -- (M-2-12.south east);
\draw[line width=0.4pt]
(M-5-3.south west) -- (M-5-12.south east);
% Box the four entries in the rightmost column:
\node[draw,thick,inner sep=0pt,fit=(M-1-12)(M-3-12)] {};
\end{tikzpicture}
\]
\end{document}
Full disclosure, I did use LLM assistance when I first cooked this up, but I have since then used this template for general multiplication problems.
documentenvironment.\begin/\end{document}. Every latex user can do this. This saves the people willing to help from having to type these boring things.