\documentclass{article}
\title{Title of Document}
\author{Name of Author}
\usepackage{sagetex}
\begin{document}
\maketitle
This is going to be awesome! $\sage{factor(2018)}$
This is going to be awesome! $\sage{factor(2018)}$
This is going to be awesome! $\sage{factor(2018)}$
This is going to be awesome! $\sage{factor(2018)}$
This is going
asldfkjasdf
alksdjf
asldkfj
alsdfjasdf
\end{document}