Results 1 to 4 of 4

Math Help - Latex - prime factor tree

  1. #1
    Newbie
    Joined
    Apr 2010
    Posts
    1

    Latex - prime factor tree

    Dear Forum,

    I'm very new to Latex and trying hard to learn how present math documents for assessment.

    Can anyone tell me how to display a prime factor tree? For example:

    630 is 2x3x3x5x7 and I'd like to display the factors using arrows in a neat diagram.

    Thanks in advance for any help.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Banned
    Joined
    Oct 2009
    Posts
    769

    Question

    Have you read the LaTex tutorial?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Kep
    Kep is offline
    Newbie Kep's Avatar
    Joined
    Jan 2010
    Posts
    21
    Quote Originally Posted by wonderboy1953 View Post
    Have you read the LaTex tutorial?
    The LaTeX tutorial doesn't show you how to do this .

    Personally, I have no idea. My LaTeX learning so far has focused on typesetting text impeccably.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member flyingsquirrel's Avatar
    Joined
    Apr 2008
    Posts
    802
    Quote Originally Posted by Kcal View Post
    Can anyone tell me how to display a prime factor tree? For example:
    It can be done using the package PGF.

    Here is an example :
    Code:
    \documentclass{article}
    
    \usepackage{tikz}
    
    \begin{document}
    
    \begin{figure}
        \centering
        \begin{tikzpicture}[
            level 1/.style={sibling distance=20mm},
            level 2/.style={sibling distance=10mm},
        ]
        \node{80}
            child{node {8}
                child{node {2}}
                child{node {2}}
                child{node {2}}
            }
            child{node {10}
                child{node {2}}
                child{node {5}}
            };
        \end{tikzpicture}
        \caption{Simple tree}
    \end{figure}
    
    
    \begin{figure}
        \centering
        \begin{tikzpicture}[
            level 1/.style={sibling distance=40mm},
            level 2/.style={sibling distance=20mm},
            level 3/.style={sibling distance=10mm}
            ]
        \node[rounded corners, draw]{720}
            child{node [rounded corners, draw] {20}
                child{node [fill=red!30,rounded corners] {2}}
                child{node [rounded corners, draw] {10}
                    child{node [fill=red!30,rounded corners] {5}}
                    child{node [fill=red!30,rounded corners] {2}}
                }
            }
            child{node [rounded corners, draw] {36}
                child{node [rounded corners, draw] {6}
                    child{node [fill=red!30,rounded corners] {2}}
                    child{node [fill=red!30,rounded corners] {3}}
                }
                child{node [rounded corners, draw] {6}
                    child{node [fill=red!30,rounded corners] {2}}
                    child{node [fill=red!30,rounded corners] {3}}
                }
            };
        \end{tikzpicture}
        \caption{Elaborated tree}
    \end{figure}
    
    \end{document}
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. A prime factor problem.
    Posted in the Number Theory Forum
    Replies: 8
    Last Post: May 1st 2011, 03:15 AM
  2. How do you factor an un-prime quadratic?
    Posted in the Algebra Forum
    Replies: 3
    Last Post: March 29th 2011, 08:30 PM
  3. Prime factor calcuation
    Posted in the Algebra Forum
    Replies: 1
    Last Post: March 15th 2010, 07:41 PM
  4. Replies: 1
    Last Post: December 14th 2009, 05:13 PM
  5. Factor or Prime?
    Posted in the Algebra Forum
    Replies: 2
    Last Post: May 4th 2008, 02:08 PM

Search Tags


/mathhelpforum @mathhelpforum