f(n) = \begin{cases} n/2 &\mbox{if } n \equiv 0 \\
(3n +1)/2 & \mbox{if } n \equiv 1 \end{cases}
I read somewhere that in the cases environment it doesn't require $ and when I do try and put $, it says I am still missing it. I am fairly new to Latex and quite confused.
\documentclass[12pt, letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\setlength{\parindent}{0pt}
\title{}
\author{}
\date{}
\begin{document}
\maketitle
\begin{tabbing}
\underline{\textbf{Problem 13.}} \\
f(n) = \begin{cases} n/2 &\mbox{if } n \equiv 0 \\
(3n +1)/2 & \mbox{if } n \equiv 1 \end{cases}
\end{tabbing}
\end{document}
\begin{cases}
is almost at the end of the file. Thecases
environment itself must be in math mode, and it isn't. Add$
at each end, as$\begin{cases} ... \end{cases}$
.\[ f(n) = \begin{cases}... \end{cases} \]
so that the equation is displayed.