Which one is correct $\sum_{n=1}^{k} 2^{n}× n^2$ or $\sum_{n=1}^{k} (2^{n}× n^2)$? I have $2$ questions about notation.
Question 1.
Suppose, numbers are as follows.

$\left\{3\right\}\longrightarrow7$
$\left\{3,6\right\}\longrightarrow9$
$\left\{3,6,7\right\}\longrightarrow11$
$\left\{3,6,7,5\right\}\longrightarrow15$
$...............$
$\left\{p_1,p_2,p_3,...p_n\right\}\longrightarrow q_n$

And $p_1,p_2,...,p_{n}$ are arbitrary natural numbers.But, the value $q_n$ depend on the values of ${p_1,p_2,...,p_n}.$
I want to write a notation.
I think, I can write, for example,

$$f(p_1,p_2,...p_n)=q_n$$ like a function.Is it correct or ıs there an other notation?

Question 2.
Which notation is correct?

$\sum_{n=1}^{k} 2^{n}× n^2$ or $\sum_{n=1}^{k} (2^{n}× n^2)$

and

$\sum_{n=1}^{k} 2^{n}+n^2$ or $\sum_{n=1}^{k} (2^{n}+n^2)$

 A: 
A word of warning to question 2: The subscript $n$ in
\begin{align*}
\sum_{n=1}^k 2^n+n^2
\end{align*}
does not tell anything about the scope of the sigma operator $\Sigma$.
  
  
*
  
*The scope of the sigma operator $\Sigma$ is solely defined via arithmetic precedence rules. It is given by the expression that follows immediately the $\Sigma$ and is valid respecting the arithmetic precedence rules up to an operator with precedence level equal to '$+$' or up to the end if no such operator follows.
  

This implies that
\begin{align*}
\color{blue}{\sum_{n=1}^k 2^n}+n^2&=\color{blue}{\sum_{n=1}^k \left(2^n\right)}+n^2=\color{blue}{\left(\sum_{n=1}^k 2^n\right)}+n^2\\
&=\color{blue}{2^1+2^2+\cdots+2^k}+n^2
\end{align*}
The scope of the Sigma symbol does not extend to $n^2$, which is a variable by its own independent of the index $n$ (and a bad naming style).
On the other hand according to the arithmetic precedence rules we have
\begin{align*}
  \sum_{n=1}^k \left(2^n+n^2\right)&=(2^1+1^2)+(2^2+2^2)\cdots (2^k+k^2)\\
  &=2^1+2^2+\cdots+2^k+1^2+2^2+\cdots+k^2\\
  &=\sum_{n=1}^k 2^n +\sum_{n=1}^k n^2
  \end{align*}

We conclude in general we have
  \begin{align*}
\sum_{n=1}^k 2^n+n^2\ne\sum_{n=1}^k \left(2^n+n^2\right)
\end{align*}

Since multiplication has higher precedence level than addition we obtain
\begin{align*}
  \sum_{n=1}^k2^n\cdot n^2&=\sum_{n=1}^k\left(2^n\cdot n^2\right)
  =2^1\cdot1^2+2^2\cdot 2^2+\cdots 2^k\cdot k^2
  \end{align*}

Hints to question 1:
The representation
  \begin{align*}
  f(p_1,p_2,\ldots,p_n)=q_n
  \end{align*}
  indicates a function $f:\mathbb{N}^n\rightarrow \mathbb{N}$. Here the argument of $f$ is an $n$-tuple $(p_1,p_2,\ldots,p_n)$ where order matters. This does not match the mapping of
  \begin{align*}
  \{p_1,p_2,\ldots,p_n\}\rightarrow q_n
  \end{align*}
  where the left-hand side is an unordered set.
We could write
  \begin{align*}
&f:\mathcal{P}(\mathbb{N})\setminus\emptyset\rightarrow \mathbb{N}\\
&f(\{p_1,p_2,\ldots,p_n\})=q_n  
\end{align*}
Here the argument is a set consisting of $n$ natural numbers. In order to avoid ambiguities we also have to specify in this case that $p_1,p_2,\ldots,p_n$ are pairwise different.

A: For question 1, yes, we can write it as a function $f$ with domain $\bigcup_{k=1}^\infty \mathbb N^k$ and codomain $\mathbb N$.
That is, $f:\bigcup\limits_{k=1}^\infty \mathbb N^k \to\mathbb N$.
For question 2, it's less ambiguous with parentheses in both cases.
Still, it's not unusual that the parentheses are left out in both cases, which is really a bit of abuse of notation. But since the $n$ is bound to the summation symbol, someone who reads it can deduce that the parentheses will be intended even if they are left out.
