In math mode, characters and numbers are placed on the baseline and develop upward and/or downward. How can they be centered vertically around the formula axis, as symbols such as + and = are?
For example in:
\documentclass{article}
\begin{document}
$n=0\ d(C,P)$
\end{document}
The n should be shifted upward, the 0, the d, the C, the comma and the P should instead be shifted downward. How can this be done automatically without having to manually set a raisebox value for each character and/or number?
Thank you for your help, it is very appreciated.
Edit: I excuse for being unclear about what I want. To clarify, my goal is to achieve what's displayed in the image that egreg posted in his comment. I hope it is clearer now, thank you again.

^nor_n? – Sigur Nov 17 '18 at 13:14$n=0$, $d(C,P)$or${}^n=_{d(C,P)}$.– Sigur Nov 17 '18 at 13:59