# Double subscript not coming with product in this formula

I am not able to write this in latex with the subscript p|n (maybe more than one line) under the product and above the product sign also I need something to be written( say k). Moreover it would be helpful if someone tells me how to display this formula in a neat manner. Thanks in Advance. • Welcome to TeX.SX! you can get the lower-limit form of the "subscript" to the product by specifying either \limits or \displaystyle. but really, you should show us what you have already tried, in the form of a "minimum working example", starting with \documentclass and ending with \end{document}. – barbara beeton Apr 4 '15 at 12:48
• @Werner Actually, it is not a duplicate as adding \displaystyle to the denominator does not fix the problem. – Andrew Apr 4 '15 at 13:36

The original picture can be reproduced by

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\frac{(-1)^{\varphi(n)/2}n^{\varphi(n)}} {\prod_{p\mid n} p^{\varphi(n)/(p-1)}}$
\end{document} whereas using \Pi instead of \prod would give which is sensibly different.

If the condition is desired to be under the product sign, the correct answer is

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\frac{(-1)^{\varphi(n)/2}\,n^{\varphi(n)}} {\prod\limits_{p\mid n} p^{\varphi(n)/(p-1)}}$
\end{document}


(note the thin space in the numerator and in the exponent at the denominator). Using \displaystyle would give a much worse output, with a too big product sign

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\frac{(-1)^{\varphi(n)/2}\,n^{\varphi(n)}} {\displaystyle\prod_{p\mid n} p^{\varphi(n)/(p-1)}}$
\end{document} Exchange \Pi for \prod\limits or \displaystyle\prod

Also, you might want to use \begin{equation} or \begin{equation*} instead of [

• This is basically the same as another already extant answer; moreover, we don't know if \Pi was actually used instead of \prod. – Paul Gessler Apr 4 '15 at 13:50
• @PaulGessler The symbol used by the OP is surely \prod, because \Pi` would sit on the baseline. – egreg Apr 4 '15 at 14:20