As already said in the comments, this problem is the main subject of Exercise 18.44 of The TeXbook. Barbara Beeton has already suggested a variation of one of the two solutions that Knuth presents in Appendix A, although her code should be modified to read, more or less,
\DeclareRobustCommand*{\sump}{%
\mathop{{\sum}^{\mathrlap{\prime}}}%
}
Here’s a complete, compilable example, that also draws attention to a possible flaw of this solution:
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
\usepackage{mathtools}
\newcommand*{\sump}{} % check that the name can be used
\DeclareRobustCommand*{\sump}{%
\mathop{{\sum}^{\mathrlap{\prime}}}%
}
\begin{document}
First in-line:
\( \sump_{i\in I}a_{i} \ne \sum_{i\in I}a_{i} \).
Then in display:
\[
\sump_{i\in I}a_{i} \ne \sum_{i\in I}a_{i}
\mbox{.}
\]
You can also say, for instance,
\( \sump\limits_{i\in I}a_{i} \ne \sum\limits_{i\in I}a_{i} \)
and
\[
\sump\nolimits_{i\in I}a_{i} \ne \sum\nolimits_{i\in I}a_{i}
\mbox{,}
\]
respectively.
There's a caveat, though: because the prime is not taken into account
when computing the width of the \verb|\sump| symbol, it may bump into
adjacent characters:
\[
\sump \biggl[\frac{a+b}{c+d}-\frac{x+y}{x-y}\biggr]
\ne \sum \biggl[\frac{a+b}{c+d}-\frac{x+y}{x-y}\biggr]
\]
The clash is more problematic in in-line math:
\( \sump[a+b] \ne \sum[a+b] \).
However, in practice this is not going to be a problem if you stick to
using the \verb|\sump| symbol only with a (non-empty) subscript.
\end{document}
However, if we have to load the mathtools package, which, in turn, requires amsmath, I think we should also support the [no]sumlimits option of the latter, as well as its \dots feature:
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
% Try decommenting the following line:
% \usepackage[nosumlimits]{amsmath}
\usepackage{mathtools}
\makeatletter
% Cannot directly use "\DeclareRobustCommand" with "\DOTSB":
\@ifdefinable\sump@{\DeclareRobustCommand*\sump@{%
\mathop{{\sum}^{\mathrlap{\prime}}}%
}}
\newcommand*\sump{%
\DOTSB\sump@\slimits@ % ...or move "\slimits@" into "\sump@"
}
\makeatother
\begin{document}
First in-line:
\( \sump_{i\in I}a_{i} \ne \sum_{i\in I}a_{i} \).
Then in display:
\begin{equation}
\sump_{i\in I}a_{i} \ne \sum_{i\in I}a_{i}
\mbox{.}
\label{eq:displaylimits}
\end{equation}
You can also say, for instance,
\( \sump\limits_{i\in I}a_{i} \ne \sum\limits_{i\in I}a_{i} \)
and
\[
\sump\nolimits_{i\in I}a_{i} \ne \sum\nolimits_{i\in I}a_{i}
\mbox{,}
\]
respectively. And see what happens in the ``default'' case (that is,
in~\eqref{eq:displaylimits}) if you load the \textsf{amsmath} package
with the \texttt{nosumlimits} option.
Finally, note that
\( \sump_{i_{1}}\dots\sump_{i_{p}} x_{i_{1}}\otimes\dots\otimes x_{i_{p}} \)
works exactly in the same way as
\( \sum_{i_{1}}\dots\sum_{i_{p}} x_{i_{1}}\otimes\dots\otimes x_{i_{p}} \)
(as one would expect). Let's repeat it in display:
\[
\sump_{i_{1}}\dots\sump_{i_{p}} x_{i_{1}}\otimes\dots\otimes x_{i_{p}}
\ne
\sum_{i_{1}}\dots\sum_{i_{p}} x_{i_{1}}\otimes\dots\otimes x_{i_{p}}
\]
(this way the formula is more readable!).
\typeout{A test for robustness: \sump}
\typeout{Compare the above with \sum}
\end{document}
Note that the above code (the second MWE) writes a couple of messages during the compilation, which exemplify how the \sump command is written out to auxiliary files, and shows that its behavior in this respect parallels that of \sum.
\DeclareMathOperator*{\sump}{\Sigma'}seems an easy solution. – Marijn Aug 31 '19 at 19:07\DeclareMathOperator*{\sump}{\Sigma^{\prime}}for a more math-like prime. – Marijn Aug 31 '19 at 19:10\DeclareMathOperatorand\DeclareMathoperator*and\mathchoicemight work... – Liam Baker Aug 31 '19 at 19:17\mathchoicemay not be necessary, the subscript position and size seems fine with just\DeclareMathOperator*. But of course you can choose any implementation you'd like :) Meanwhile I think it would be best to close this question as a duplicate of the other one. – Marijn Aug 31 '19 at 19:25\sum; there may or may not be an upper limit. If there is no upper limit except in a display environment, then\sum^{\rlap{\prime}}might work. (I'm unable to test, so this is just a suggestion.) – barbara beeton Aug 31 '19 at 19:28$and}signs... – Liam Baker Aug 31 '19 at 19:56\DeclareMathOperator*{\sump}{{\sum}'}, is slightly defective (why? ;-) ; the second, more sophisticated, is too complex to be repeated in a comment. See the solution of the exercise in The TeXbook. – GuM Aug 31 '19 at 20:49\mathrlap, Requiresmathtools. – barbara beeton Aug 31 '19 at 20:51\sum. Strangely enough, your suggestion doesn't seem to work in text mode when wrapped in a\mathchoice... – Liam Baker Sep 02 '19 at 11:28\mathop{{\sum}^{\mathrlap{\prime}}}. – GuM Sep 21 '19 at 08:58\sumpoperator. By the way, I’ve just realized that I had never upvoted your question: fixed! ;-) – GuM Sep 21 '19 at 20:31