I want to write something like
12|2 10|2
6|2 5|5
3|3 1|
1|
It can be one o more decompositions in prime numbers. I can't obtain and straight line. This example is the decomoposition of 12 (2x2x3) and 10 (2x5).
Thx
Math & Science ⇒ how can it be written the least common denominator
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Posts: 3
- Joined: Sun Feb 15, 2015 6:11 pm
how can it be written the least common denominator
How about
Code: Select all
\begin{equation}
\label{eq:temp}
\begin{array}{r|l}
12 & 2 \\
6 & 2 \\
3 & 3 \\
1 &
\end{array}\notag
\end{equation}
how can it be written the least common denominator
Thx
The array approach is good to one lcd decomñposition but I see difficult to use in multiple lcd decompositions.
In a similar way, I used the tabular approach but it comes with some troubles. The next example show that the first decomposition has the line too large. I can order by size (first the 16 decomposition, in the middle the 12 decomposition and last the 10 decomposition) but I wonder that not exists a \decomposition command.
The array approach is good to one lcd decomñposition but I see difficult to use in multiple lcd decompositions.
In a similar way, I used the tabular approach but it comes with some troubles. The next example show that the first decomposition has the line too large. I can order by size (first the 16 decomposition, in the middle the 12 decomposition and last the 10 decomposition) but I wonder that not exists a \decomposition command.
Code: Select all
\begin{tabular}{r|l r|l r|l}
12 & 2 &16 & 2 & 10 & 2\\
6 & 2 & 8 & 2 & 5 & 5\\
3 & 3 & 4 & 2 & 1\\
1 & &2 & 2\\
& & 1
\end{tabular}
\subsection{A subsection}
how can it be written the least common denominator
I'm not sure what you're trying to achieve exactly---or should I say, what exactly your problem is?, but you can put more than one array environment into one math env.Krio wrote: The array approach is good to one lcd decomñposition but I see difficult to use in multiple lcd decompositions.
If that's not enough, you can define your own environment, say
Code: Select all
\documentclass{article}
\newenvironment{denom}{%
\setlength\arraycolsep{1.5pt}%
\array[t]{@{}r|r@{}}}{\endarray}
\begin{document}
\[
\begin{denom}
12 & 2\\
6 & 2\\
3 & 3\\
1&
\end{denom}\quad
\begin{denom}
26 & 2\\
13 & 13\\
1&
\end{denom}\quad
\begin{denom}
256 & 2\\
128 & 2\\
64 & 2\\
32 & 2\\
16 & 2\\
8 & 2\\
4 & 2\\
2 & 2\\
1 &
\end{denom}
\]
\end{document}
If I understand you right, that would mean something like parsing through prime numbers (starting at 2, but how far should they go?), check, if the number provided can be divided by the current prime number (and how often) ...
KR
Rainer