Ternary universal sums of generalized\\ polygonal numbers
Jangwon Ju
Byeong-Kweon Oh and Bangnam Seo
An integer of the form $p_m(x)= \frac{(m-2)x^2-(m-4)x{2 \ (m\ge 3)$, for some integer $x$ is called a generalized polygonal number of order $m$. A ternary sum $\Phi_{i,j,k^{a,b,c(x,y,z)=ap_i(x)+bp_j(y)+cp_k(z)$ of generalized polygonal numbers, for some positive integers $a,b,c$ and some integers $i,j,k \ge 3$, is said to be {universal if for any positive integer $n$, the equation $\Phi_{i,j,k^{a,b,c(x,y,z)=n$ has an integer solution $x,y,z$. In this article, we prove the universalities of $17$ ternary sums of generalized polygonal numbers listed in (\ref{list). This was conjectured by Sun in \cite{s2.
1612.01157.tex
 \documentclass{amsart}
\usepackage{amssymb, amsmath, latexsym, mathabx, dsfont}

\linespread{1.3}
\renewcommand{\baselinestretch}{\baselinestretch}
\renewcommand{\baselinestretch}{1.1}
\numberwithin{equation}{section}

\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{prop}[thm]{Proposition}

\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{xca}[thm]{Exercise}

\theoremstyle{remark}
\newtheorem{rmk}[thm]{Remark}
\newtheorem{exam}[thm]{Example}

\newcommand{\ra}{{\rightarrow}}
\newcommand{\rad}{\text{rad}}
\newcommand{\nra}{{\nrightarrow}}
\newcommand{\gen}{\text{gen}}
\newcommand{\spn}{\text{spn}}
\newcommand{\ord}{\text{ord}}
\newcommand{\diag}{\text{diag}}
\newcommand{\z}{{\mathbb Z}}
\newcommand{\q}{{\mathbb Q}}
\newcommand{\f}{{\mathbb F}}
\newcommand{\rank}{\text{rank}}
\newcommand{\s}{{\mathfrak s}}
\newcommand{\n}{{\mathfrak n}}
\newcommand{\level}{{\mathfrak l}}
\newcommand{\h}{{\mathbb H}}
\newcommand{\p}{{\mathbb P}}
\newcommand{\plane}{{\mathbb A}}
\newcommand{\e}{{\epsilon}}
\newcommand{\T}{{\tilde{T}}}
\newcommand{\gr}{{\mathfrak{G}_{L,p}(m)}}
\newcommand{\cgr}{{\mathcal{G}_{L,p}(m)}}
\newcommand{\mbw}{{\mathcal M_{B,\mathbf w}^{\mathbf s}}}
\newcommand{\mbz}{{\mathcal M_{B,\mathbf 0}^{\mathbf s}}}
\newcommand{\ubw}{{\mathcal U_{B,\mathbf w}^{\mathbf s}}}
\newcommand{\ubz}{{\mathcal U_{B,\mathbf 0}^{\mathbf s}}}



\begin{document}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[Ternary universal sums of generalized polygonal numbers]{Ternary universal sums of generalized\\ polygonal numbers}

\author{Jangwon Ju,  Byeong-Kweon Oh and Bangnam Seo}

\address{Department of Mathematical Sciences, Seoul National University, Seoul 08826, Korea}
\email{jjw@snu.ac.kr}
\thanks{This work of the first author was supported by BK21 PLUS SNU Mathematical Sciences Division.}

\address{Department of Mathematical Sciences and Research Institute of Mathematics, Seoul National University, Seoul 08826, Korea}
\email{bkoh@snu.ac.kr}
\thanks{This work of the second author was supported by the National Research Foundation of Korea (NRF-2014R1A1A2056296).}

\address{Department of Mathematical Sciences, Seoul National University, Seoul 08826, Korea}
\email{bangnam1@snu.ac.kr}

\subjclass[2000]{Primary 11E12, 11E20}

\keywords{generalized polygonal numbers, ternary universal sums}




\begin{abstract} An integer of the form $p_m(x)= \frac{(m-2)x^2-(m-4)x}{2} \ (m\ge 3)$, for some integer $x$ is called a generalized polygonal number of order $m$.  A ternary sum 
$\Phi_{i,j,k}^{a,b,c}(x,y,z)=ap_i(x)+bp_j(y)+cp_k(z)$  of generalized polygonal numbers,  for some positive integers $a,b,c$ and some integers $i,j,k \ge 3$,  is said to be {\it universal} if for any positive integer $n$, the equation $\Phi_{i,j,k}^{a,b,c}(x,y,z)=n$ has an integer solution $x,y,z$.  In this article, we prove the universalities of $17$ ternary sums  of generalized polygonal numbers listed in (\ref{list}).  This was conjectured by Sun in \cite{s2}. 
\end{abstract}

\maketitle


\section{Introduction} 
 A polygonal number is a number represented as dots or pebbles arranged in the shape of a regular polygon. More precisely,   {\it a polygonal number of order $m$} (or {\it an $m$-gonal number}) for $m\ge3$ is defined by
$$
p_m(x)= \frac{(m-2)x^2-(m-4)x}{2}
$$
for some non negative integer $x$. If we admit that $x$ is a  negative integer, then $p_m(x)$ is called  
{\it a generalized polygonal number of order $m$} (or {\it a generalized $m$-gonal number}). 
By definition, every polygonal number of order $m$ is a generalized polygonal number of order $m$. However, the converse is  true only when $m=3,4$. 

A famous assertion of Fermat states that every positive integer can be expressed as a  sum of three triangular numbers, which was proved by  Gauss in 1796. 
This follows from the Gauss-Legendre theorem, which states that every positive integer which is not of the form $4^k(8l+7)$ with  non negative integers $k$ and $l$, is a sum of three squares of integers.  

In general, a ternary sum $\Phi_{i,j,k}^{a,b,c}=ap_i(x)+bp_j(y)+cp_k(z) \ (a,b,c >0)$ of polygonal numbers is called {\it universal over $\mathbb N$} if  for any non negative integer $n$, the diophantine equation
\begin{equation} \label{fund}
ap_i(x)+bp_j(y)+cp_k(z)=n
\end{equation}
has  a {\it non negative} integer solution $x,y,z$. It is called {\it universal over $\mathbb \z$} if the above equation has an integer solution. 
%In this case, we say that $\Phi_{i,j,k}^{a,b,c}$ is a ternary universal sum of generalized polygonal numbers.

In 1862, Liouville generalized Gauss's triangular theorem as follows:
 for positive integers $a,b,c \ (a \leq b \leq c)$, the ternary sum $ap_3(x)+bp_3(y)+cp_3(z)$ of triangular numbers is universal if and only if $(a,b,c)$ is one of  the following triples:
$$
\begin{array}{llllllll}
&(1,1,1), &(1,1,2), &(1,1,4), &(1,1,5), &(1,2,2), &(1,2,3), &(1,2,4).
\end{array}
$$
In \cite{gps}, \cite{os} and \cite{s1}, Sun and his collaborators determined  all  ternary universal sums of the form $ap_3(x)+bp_3(y)+cp_4(z)$ or $ap_3(x)+bp_4(y)+cp_4(z)$.  There does not exist a universal sum of the form $ap_4(x)+bp_4(y)+cp_4(z)$ for  any positive integers $a,b,c$. 
Hence,  to find all ternary sums of polygonal numbers that are universal over $\mathbb N$, we may assume that $\{i,j,k\} \ne \{3,4\}$. Recently, Sun gave in \cite{s2} a complete list of $95$  candidates of  ternary  sums of polygonal numbers that are universal over $\mathbb N$ under this assumption. 

In fact, the proof of the universality over $\z$ of a ternary sum of polygonal numbers is much easier than the proof of universality over $\mathbb N$.  For this reason, one may naturally ask the universalities over $\z$ of $95$ candidates of ternary sums.  Related with this question, Sun and Ge proved  in \cite{fz} and \cite{s2} that $62$ ternary sums among $95$ candidates are, in fact, universal over $\z$. 
The remaining $33=95-62$ candidates are  as follows:
\begin{equation} \label{list}
{\setlength\arraycolsep{2pt}
\begin{array}{lllll}
&{\bf p_3+9p_3+p_5},&{\bf p_3+2p_4+4p_5},&{\bf p_3+4p_4+2p_5},&{\bf p_3+2p_3+p_7},\\
&{\bf p_3+p_4+2p_7},&{\bf p_3+p_5+p_7},&p_3+p_5+4p_7,&{\bf p_3+2p_5+p_7},\\
&{\bf p_3+p_7+2p_7},&{\bf p_3+2p_3+2p_8},&{\bf p_3+p_7+p_8},&{\bf p_3+2p_3+p_9},\\
&p_3+2p_3+2p_9,&{\bf p_3+p_4+p_9},&p_3+p_4+2p_9,&p_3+2p_4+p_9,\\
&{\bf p_3+p_5+2p_9},&{\bf 2p_3+p_5+p_9},&{\bf p_3+p_3+p_{12}},&{\bf p_3+2p_3+p_{12}},\\
&p_3+2p_3+2p_{12},&p_3+p_4+p_{13},&{\bf p_3+p_5+p_{13}},&p_3+2p_3+p_{15},\\
&p_3+p_4+p_{15},&p_3+2p_3+p_{16},&p_3+p_3+p_{17},&p_3+2p_3+p_{17},\\
&p_3+p_4+p_{17},&p_3+2p_4+p_{17},&p_3+p_4+p_{18},&p_3+2p_3+p_{23},\\
&p_3+p_4+p_{27}.\\
\end{array}}
\end{equation}
In this paper, we prove that  $17$  ternary sums written in boldface in the above remaining candidates are universal over $\mathbb Z$.  In most cases, we use the method developed in 
\cite{pentagonal}.  For those who are  unfamiliar with it, we briefly review this method in Section 2.  

The term ``lattice'' will always refer to a positive definite integral $\mathbb Z$-lattice on an $n$-dimensional positive definite quadratic space over $\mathbb Q$. Let $L=\mathbb{Z}x_1+\cdots+\mathbb{Z}x_n$ be a $\mathbb Z$-lattice of rank $n$. The corresponding symmetric matrix $M_L$ is defined by
$$
M_L= (B(x_i,x_j)).
$$
If $M_L$ is diagonal, then we simply write $L=\langle Q(x_1),\dots,Q(x_n)\rangle$.  The genus of $L$ is the set of all lattices that are locally isometric to $L$, which is denoted by $\gen(L)$.  The subset of  $\gen(L)$ consisting of all lattices that are isometric to  $L$ itself is denoted by $[L]$.   An integer $a$ is called {\it an eligible integer of $L$} if it is locally represented by $L$. Note that any eligible integer of $L$ is represented a lattice in the genus of $L$.    
The set of all eligible integers of $L$ is denoted by $Q(\gen(L))$.  Similarly, $Q(L)$ denotes the set of all integers that are represented by $L$ itself.   
  For an integer $a$, $R(a,L)$ denotes the set of all vectors $x\in L$ such that $Q(x)=a$, and $r(a,L)$ denotes its cardinality. For a set $S$, we define $\pm S=\{ s : s \in S \ \text{or} -s \in S\}$. For two vectors $v=(v_1,v_2,\dots,v_n), w=(w_1,w_2,\dots,w_n) \in \z^n$ and a positive integer $s$, if $v_i\equiv w_i \pmod s$ for any $i=1,2,\dots,n$, then we write $v\equiv w \pmod s$.

Any unexplained notations and terminologies can be found in \cite{ki} or \cite{om}.


\section{General tools}
Let $i,j$ and  $k$ be integers with $1 \le i \le j \le k$. Recall that for positive integers $a,b$ and $c$, a ternary sum 
$$
\Phi_{i,j,k}^{a,b,c}(x,y,z)=ap_{i+2}(x)+bp_{j+2}(y)+cp_{k+2}(z)
$$
 of generalized polygonal numbers is universal  over $\z$ if  $\Phi_{i,j,k}^{a,b,c}(x,y,z)=n$ 
has an integer solution for any non negative integer $n$.  Since any generalized hexagonal number is a triangular number and vice versa, we always assume that neither $i,j$ nor $k$  is $4$. 
Note that $\Phi_{i,j,k}^{a,b,c}$ is universal over $\z$ if and only if the equation
\begin{equation} \label{im}
\begin{array} {rl}
&jka(2ix-(i-2))^2+ikb(2jy-(j-2))^2+ijc(2kz-(k-2))^2\\
&\hskip 1cm =8ijkn+jka(i-2)^2+ikb(j-2)^2+ijc(k-2)^2=: \Psi_{i,j,k}^{a,b,c}(n)
\end{array}
\end{equation}
has an integer solution for any non negative integer $n$.  This is equivalent to the existence of an integer solution $X,Y$ and $Z$ of the diophantine equation
\begin{equation}\label{cong}
jkaX^2+ikbY^2+ijcZ^2=\Psi_{i,j,k}^{a,b,c}(n)
\end{equation}
 satisfying the following congruence condition
 \begin{equation} \label{cong2}
X\equiv -i+2 \ (\text{mod } 2i),~  Y\equiv -j+2 \ (\text{mod }{2j})   \text{ and } Z\equiv -k+2 \ (\text{mod }{2k}).
\end{equation} 

 In some particular cases, representations of quadratic forms with  some congruence conditions corresponds to representations of a subform which is taken suitably(for details, see \cite{jko}).  The following lemma reveals this correspondence more concretely in our case. 


\begin{lem}  \label{aaa}  Assume that $i,j,k$ and $a,b,c$ given above satisfy the followings:
\begin{itemize}
\item [(i)] $\{i,j,k\} \subset \mathcal S_P=\{ 1, 2, p^n, 2p^n : \text{$p$ is an odd prime and $n\ge1$}\}$;
\item [(ii)] all of $(i,jka)$, $(j,ikb)$ and $(k,ijc)$ are one or two;
\item [(iii)] either $i,j,k$ are all even or some of them are odd and 
$$
\Psi_{i,j,k}^{a,b,c}(n) \not \equiv 0 \pmod {2^{3+\text{ord}_2(ijk)}}.
$$
\end{itemize}
Then there is a quadratic form $Q(x,y,z)$ such that for any integer $n$,  $Q(x,y,z)=\Psi_{i,j,k}^{a,b,c}(n)$ has an integer solution if and only if Equation (\ref{cong}) satisfying (\ref{cong2}) has an integer solution.
\end{lem} 
\begin{proof}  Note that for any $s \in \mathcal S_P$ and any integer $a$ with $(a,s)=1$, the congruence equation $x^2\equiv a^2 \pmod s$ has at most two incongruent integer solutions modulo $s$. 
 
 First, assume that  all of $i,j$ and $k$ are even. From the assumption, we have $i \equiv j\equiv k \equiv 2 \pmod 4$.  Define
$$
Q(x,y,z)=16(jkaX^2+ikbY^2+ijcZ^2).
$$
Assume that  $(u,v,w) \in \z^3$ is an integer solution of $Q(x,y,z)=\Psi_{i,j,k}^{a,b,c}(n)$. Then 
$$
16jkau^2 \equiv  jka(i-2)^2 \pmod {32i}.  
$$ 
From this and the conditions (i) and (ii) follows $4u \equiv \pm(i-2) \pmod {2i}$. Similarly,  we have $4v \equiv \pm(j-2) \pmod {2j}$ and $4k \equiv \pm(k-2) \pmod {2k}$.  Therefore by choosing  the signs  suitably, 
we may find an integer solution of Equation (\ref{cong}) satisfying (\ref{cong2}).  For the converse, note that any integers $X,Y,Z$ satisfying the condition (\ref{cong2}) are divisible by $4$. 


Assume that exactly one of $i,j,k$, say $i$, is odd.  Define 
$$
Q(x,y,z)=jkaX^2+16(ikbY^2+ijcZ^2).
$$
Assume that  $(u,v,w) \in \z^3$ is an integer solution of $Q(x,y,z)=\Psi_{i,j,k}^{a,b,c}(n)$.
Since 
$$
16ikbv^2 \equiv ikb(j-2)^2 \pmod j \quad \text{and} \quad 16ijcw^2\equiv ijc(k-2)^2 \pmod k,
$$
and  $(j, ikb)=(k,ijc)=2$ from (ii), we have 
$$
16v^2\equiv (j-2)^2 \ \left(\text{mod } {\frac j2}\right) \quad \text{and}\quad 16w^2\equiv (k-2)^2 \ \left(\text{mod } {\frac k2}\right),
$$   
which implies that $4v \equiv \pm(j-2) \pmod {2j}$ and $4k \equiv \pm(k-2) \pmod {2k}$. Now since $jkau^2 \equiv jka(i-2)^2 \pmod {32i}$ and $a \not \equiv 0 \pmod 8$ by the condition (iii), we have $u^2 \equiv (i-2)^2 \pmod {2i}$.  Hence $u \equiv \pm (i-2) \pmod {2i}$. Therefore by choosing the signs suitably, we may find an integer solution of (\ref{cong}) satisfying (\ref{cong2}).

Assume that exactly two of $i,j,k$, say $j,k$, are odd.  Define 
$$
Q(x,y,z)=16jkaX^2+ikbY^2+ijc(Y-4Z)^2.
$$
Assume that  $(u,v,w) \in \z^3$ is an integer solution of $Q(x,y,z)=\Psi_{i,j,k}^{a,b,c}(n)$.
Then, similarly to the above, we may easily show that
$$
4u\equiv \pm(i-2) \ \left(\text{mod } {\frac i2}\right), \ v\equiv \pm(j-2) \pmod {j}, \  v-4w \equiv \pm(k-2)\pmod{k}.
$$ 
Since $i \equiv 2\pmod 4$, we have $4u\equiv \pm(i-2) \pmod {2i}$. Furthermore, since
$$
ikbv^2+ijc(v-4w)^2\equiv ikb+ijc  \not \equiv 0 \ (\text{mod }16),
$$
$v$ is odd. Hence 
$$
v\equiv \pm(j-2) \ (\text{mod } 2j), \  v-4w \equiv \pm(k-2) \ (\text{mod }2k).
$$
Therefore by choosing the signs suitably, we may find  an integer solution of (\ref{cong}) satisfying (\ref{cong2}).  Conversely, if Equation (\ref{cong}) satisfying (\ref{cong2}) has an integer solution $X,Y,Z$, then $X$ is divisible by $4$ and both $Y$ and $Z$ are odd. Hence $Y\equiv Z\pmod4$ or $Y \equiv-Z \pmod 4$. This implies that  $Q(x,y,z)=\Psi_{i,j,k}^{a,b,c}(n)$ has an integer solution.
 
Finally, if all of $i,j,k$ are odd, then we define
$$
Q(x,y,z)=jkaX^2+ikb(X-4Y)^2+ijc(X-4Z)^2.
$$
The proof of the remaining part is quite similar to the above. 
\end{proof}
\begin{rmk} \label{goodcase}  Among $33$ candidates given in the introduction, those who do not satisfy the conditions in Lemma \ref{aaa} are the cases
$$
4, \ 7, \ 9,\ 14, \ 16, \ 24,\ \text{and} \ 27\sim 32.
$$
For $4$-th, $9$-th and $14$-th cases  among them, we prove their universalities by using some other methods. For details, see Section 3. 
\end{rmk}


For the representation of an arithmetic progression by a ternary quadratic form,  
 we use the method developed in \cite{regular} and \cite{pentagonal}.  For those who are unfamiliar with this, we briefly introduce how it works. 

Let $d$ be a positive integer and let $a$ be a non negative integer $(a\leq d)$. We define 
$$
S_{d,a}=\{dn+a \mid n \in \mathbb N \cup \{0\}\}.
$$
For ternary $\mathbb Z$-lattices $M,N$ on the quadratic space $V$, we define
$$
R(N,d,a)=\{x\in N/dN \mid Q(x)\equiv a \ (\text{mod }d) \}
$$
and
$$
R(M,N,d)=\{\sigma \in O(V) \mid \sigma(dN)\subset M\}.
$$
A coset (or, a vector in the coset) $v\in R(N,d,a)$ is said to be {\it good} with respect to $M,N,d \text{ and }a$ if for any $x\in N$ satisfying $x\equiv v \pmod d$, there is a $\sigma\in R(M,N,d)$ such that $\sigma(x)\in M$. 
If every vector contained in $R(N,d,a)$ is good, we write
$$
N\prec_{d,a} M.
$$
The set of all good vectors in $R(N,d,a)$ is denoted by $R_M(N,d,a)$.
If $N\prec_{d,a} M$, then by Lemma 2.2 of \cite{regular},  we have 
$$
S_{d,a}\cap Q(N) \subset Q(M).
$$
Note that the converse is not true in general.

The following theorem is a slightly modified version of Corollary 2.2 of \cite{pentagonal}: 

\begin{thm}\label{maintool}
Under the same notations given above, assume that there is a partition $R(N,d,a)-R_M(N,d,a)=(P_1\cup \cdots \cup P_k) \cup (\widetilde{P}_1\cup \cdots \cup \widetilde{P}_{k'})$ satisfying the following properties: for each $P_i$, there is a  $\tau_i\in O(V)$ such that
\begin{enumerate}
\item[(i)] $\tau_i$ has an infinite order;
\item[(ii)] $\tau_i(dN)\subset N$;
\item[(iii)]  for any $v\in P_i$, $\tau_i(v)\in N$ and $\tau_i(v)\pmod d \in P_i \cup R_M(N,d,a)$, 
\end{enumerate}
and for each $\widetilde{P}_j$, there is a $\widetilde{\tau}_{j}\in O(V)$ such that
\begin{enumerate}
\item[(iv)] $\widetilde{\tau}_{j} (dN)\subset N$;
\item[(v)] for any $v\in \widetilde{P}_j$,  $\widetilde{\tau}_{j} (v)\in N$ and  $\widetilde{\tau}_{j} (v)\pmod d \in P_1\cup\cdots\cup P_k \cup R_M(N,d,a)$. 
\end{enumerate}
Then we have
$$
(S_{d,a} \cap Q(N)) - \bigcup_{i=1}^{k} Q(z_i){\mathbb Z}^2\subset Q(M),
$$
where the vector $z_i$ is a primitive vector in $N$ which is an eigenvector of $\tau_i$.
\end{thm}

\begin{proof}
From the conditions (iv) and (v), we may assume that 
$$
R(N,d,a)-R_M(N,d,a)=P_1\cup \cdots \cup P_k.
$$ 
Hence the theorem follows directly from Corollary 2.2 in \cite{pentagonal}.
\end{proof}

\begin{lem}  \label{spinor}  Let $L$ be a ternary $\z$-lattice with class number greater than $1$. Assume that the genus of $L$ contains only one spinor genus. 
If an integer $a$ is represented by all isometric classes in the genus of $L$ except at most only one isometric class, then for any positive integer $s>1$ with $(s,dL)=1$, $as^2$ is represented by all lattices in the genus of $L$.  
\end{lem}

\begin{proof} Without loss of generality, we may assume that there is a $\z$-lattice, say $M$, that does not represent $a$. For any prime $p$ not dividing $dL$, the graph $Z(p,L)$ defined in \cite{bh} is connected. Hence there is a $\z$-lattice $M'$ such that $M'$ is adjacent to $M$ and $a$ is represented by $M'$. Since $pM'$ is represented by $M$, $ap^2$ is represented by $M$. This completes the proof.   \end{proof}

\section{Ternary universal sums of polygonal numbers}

In this section, we prove that 17 ternary sums of generalized polygonal numbers among 33 candidates are, in fact,  universal over $\mathbb Z$. For the list of all candidates, see (\ref{list}) in the introduction.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\ 
\textbf{(i)} $p_3(x)+9p_3(y)+p_5(z)$.  First, we define
$$
M=\langle 4, 12, 27\rangle, \quad N=\langle3, 4,12\rangle.
$$
Note that the class number of $N$ is one and every integer of the form $24n+7$ is represented by $N$. 
 One may easily show by a direct computation that $(v_1,v_2,v_3)\in R(N,24,7)-R_M(N,24,7)$ 
if and only if  $v_1,v_2\equiv\pm1\pmod6$, $v_3\equiv0\pmod6$ and satisfies the following properties: 
$$
\begin{cases}
v_1\equiv v_2+v_3\pmod4 &\text{if } v_1\equiv v_2\pmod6,\\
v_1+v_2+v_3\equiv0\pmod4 &\text{otherwise}.
\end{cases}
$$
Note that $R(N,24,7)-R_M(N,24,7)$ contains exactly 128 vectors.
%contains $128$ vectors, and for any vector $(v_1,v_2,v_3)$ in the set, $v_1\equiv v_2 \equiv 1 \pmod 2$ and  $v_3 \equiv 0 \pmod 2$. 
Define 
$$
R(N,24,7)-R_M(N,24,7)=P_1 \cup \widetilde{P}_1,
$$ 
where
\begin{eqnarray*}
P_1\!\!\!&=&\!\!\!\{(v_1 ,v_2 ,v_3)\in R(N,24,7)-R_M(N,24,7) \mid v_1 +v_2  +v_3 \equiv 0 \ (\text{mod }4) \},\\
\widetilde{P}_1\!\!\!&=&\!\!\!\{(v_1 ,v_2 ,v_3)\in R(N,24,7)-R_M(N,24,7) \mid v_1\equiv v_2 +v_3 \ (\text{mod }4) \},
\end{eqnarray*}
and
$$
\tau_1=\frac{1}{24}\begin{pmatrix}0&24&24\\18&-6&18\\-6&-6&18\end{pmatrix}, \qquad 
\widetilde{\tau}_{1}=\frac{1}{24}\begin{pmatrix}0&-24&-24\\18&6&-18\\-6&6&-18\end{pmatrix}.
$$
Then it satisfies all conditions in Theorem \ref{maintool}.  The eigenvector of $\tau_1$ is $z_1=(1,-1,0)$ and $\widetilde{\tau}_1(-1,-1,0)=(1,-1,0)$.  Hence if $24n+7$ is not of the form $Q(\pm t,\mp t, 0)=7t^2$ for some positive integer $t$, then it is also represented by $M$.  Assume that $24n+7=7t^2$ for a positive integer $t$ and there is a prime $p>3$ dividing $t$. Since the class number of $N$ is one, we have
$$
r(7p^2,N)=4p+4-4\cdot\left(\frac{-7}{p}\right)>4
$$
by the Minkowski-Siegel formula.  Hence there is a representation which is neither contained in the eigenspace   of $\tau_1$ nor the inverse image of the eigenspace by $\widetilde{\tau}_1$.  Therefore 
every integer of the form $24n+7$ for a positive integer $n$  is represented by $M$, that is,
the equation 
$$
24n+31=(Y-4X)^2+3Y^2+27Z^2 =4(Y-X)^2+12X^2+27Z^2
$$
has an integer solution $X,Y,Z$ for any integer $n$.  Since $Y-4X\equiv Y\equiv Z \equiv 1\ (\text{mod } 2)$ and $Y-4X \equiv \pm 1 \pmod 3$,      
the equation
$$
3(2x+1)^2+27(2y+1)^2+(6z-1)^2=24n+31
$$
has an integer solution for any non negative integer $n$, which implies that the ternary sum $p_3(x)+9p_3(y)+p_5(z)$ is universal over $\z$ by (\ref{im}). 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(ii)} $p_3(x)+2p_4(y)+4p_5(z)$. Let 
$$
M=\langle3, 4, 48\rangle, \quad N=\langle3, 4, 12\rangle.
$$
Since $S_{24,7} \subset Q(\gen(N))$ and $h(N)=1$, we have $S_{24,7} \subset Q(N)$. One may easily show that
$$
R(N,4,3)-R_M(N,4,3)=\pm\{(1,0,1),(1,0,3),(1,2,1),(1,2,3)\}.
$$
Let $P_1=\pm\{(1,0,1),(1,2,3)\}$, $\widetilde{P}_1=\pm\{(1,0,3),(1,2,1)\}$ and 
$$
\tau_1=\frac14\begin{pmatrix}0&-4&-4\\3&1&-3\\-1&1&-3\end{pmatrix},\quad \widetilde{\tau}_{1}=\frac14\begin{pmatrix}0&4&4\\3&-1&3\\-1&-1&3\end{pmatrix}.
$$
Then one may easily show that it satisfies all conditions in Theorem \ref{maintool}. The eigenvector of $\tau_1$ is $z_1=(1,0,1)$ and $Q(z_1)=15$, which is not of the form $24n+7$.    Therefore we have $S_{24,7}\subset Q(M)$. This implies that the equation $3X^2 +4Y^2+48Z^2=24n+7$
has an integer solution $X,Y,Z$ for any non negative integer $n$. Since $X$ is odd and $Y$ is relatively prime to $6$, the equation
$$
3(2x+1)^2+48y^2+4(6z-1)^2=24n+7
$$ 
has an integer solution for any non negative integer $n$. Hence by  (\ref{im}), the ternary sum $p_3(x)+2p_4(y)+4p_5(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(iii)} $p_3(x)+4p_4(y)+2p_5(z)$. Let 
$$
M=\langle2, 3, 96\rangle,\quad N=\begin{pmatrix}5&1&1\\1&11&-1\\1&-1&11\end{pmatrix}\quad \text{and} \quad N'=\langle2\rangle\perp\begin{pmatrix}12&6\\6&27\end{pmatrix}.
$$
Note that $\text{gen}(M)=\{[M],[N],[N']\}$ and $S_{24,5}\subset Q(\text{gen}(M))$.
One may easily show  that $N'\prec_{4,1} N$. Furthermore,  $R(N,12,5)-R_M(N,12,5)$ consists of following vectors:
$$
\begin{array}{lllll}
&\pm(3,1,7),&\pm(3,2,8),&\pm(3,4,10),&\pm(3,5,11),\\
&\pm(3,7,1),&\pm(3,8,2),&\pm(3,10,4),&\pm(3,11,5).
\end{array}
$$
If we define $P_1=R(N,12,5)-R_M(N,12,5)$ and  
$\tau_1=\frac{1}{12}\begin{pmatrix}8&10&-10\\-6&-3&-9\\2&-11&-1\end{pmatrix}$, then $P_1$ and $\tau_1$  satisfies all  conditions in Theorem \ref{maintool}.
Since the eigenvector of $\tau_1$ is $z_1=(0,1,1)$ and $Q(z_1)=20$, which is not of the form $24n+5$,  we have  $S_{24,5}\cap Q(N)\subset Q(M)$.
Therefore every integer of the form $24n+5$, for any non negative integer $n$ is represented by $M$.  
If the equation $2X^2+3Y^2+96Z^2=24n+5$ has an integer solution $X,Y,Z$, then $X$ is relatively prime to $6$ and $Y$ is odd. Hence the equation
$$
3(2x-1)^2+96y^2+2(6z-1)^2=24n+5
$$ 
has an integer solution for any non negative integer $n$. Therefore the ternary sum  $p_3(x)+4p_4(y)+2p_5(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(iv)} $p_3(x)+2p_3(y)+p_7(z)$. First, we show that for any eligible integer $8n$ of  $F(X,Y,Z)=X^2+5Y^2+10Z^2$, the equation $F(X,Y,Z)=8n$ has an integral solution 
$(X,Y,Z)=(a,b,c)$ with $a\equiv b\equiv c\equiv 1 \pmod2$, unless $n\equiv 0 \pmod 5$. 
Since the class number of $F$ is $1$, $F(X,Y,Z)=8n$ has an integer solution $(X,Y,Z)=(a,b,c)$. One may easily check that all of $a,b$ and $c$ have same parity.
 Suppose that $a,b$ and $c$ are all even.  Then $a\equiv b\pmod 4$ and there is another representation 
 $$
F\left(\frac{a+5b+10c}{4},\frac{-a+3b-2c}{4},\frac{-a-b+2c}{4}\right)=F(a,b,c)=8n.
$$  
Since there are only finitely many representations of $8n$  and  $\tau=\frac14\begin{pmatrix}1&5&10\\-1&3&-2\\-1&-1&2\end{pmatrix}$ has an infinite order, there is a positive integer $m$ such that each  component of the vector $\tau^m (a,b,c)=(a_m,b_m,c_m)$  is odd, unless $(a,b,c)$ is not an eigenvector of $\tau_1$.  Note that $(a,b,c)=(0,-2t,t)$ is an eigenvector of $\tau$ and $F(0,-2t,t)=30t^2$.

Note that any positive integer of the form $40n+24$ for some non negative integer $n$ is an eligible integer of  $F$ and the class number of $F$ is one. Hence the equation $F(X,Y,Z)=40n+24$ has an integer solution $X,Y,Z$ such that  $X\equiv Y\equiv Z \equiv 1 \pmod 2$ and $X\equiv \pm 2\pmod5$, which implies that    
$$
5(2x-1)^2+10(2y-1)^2+(10z-3)^2=40n+24
$$ 
has an integer solution for any non negative integer $n$. Therefore by (\ref{im}),  the ternary sum $p_3(x)+2p_3(y)+p_7(z)$ is universal over $\z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(v)} $p_3(x)+p_4+2p_7(z)$. Let
$$
M=\langle2, 5, 40\rangle,\quad N=\langle5, 8, 10\rangle.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$. The set $R(N,8,7)-R_M(N,8,7)$ consists of following vectors:
$$
\begin{array}{lllllll}
&\pm(1,0,1),&\pm(1,0,7),&\pm(1,2,3),&\pm(1,2,5),&\pm(1,4,1),&\pm(1,4,7),\\
&\pm(1,6,3),&\pm(1,6,5),&\pm(3,0,3),&\pm(3,0,5),&\pm(3,2,1),&\pm(3,2,7),\\
&\pm(3,4,3),&\pm(3,4,5),&\pm(3,6,1),&\pm(3,6,7).
\end{array}
$$
Let
\begin{eqnarray*}
P_1&=&\{(v_1,v_2,v_3)\in R(N,8,7)-R_M(N,8,7)\mid v_1\equiv v_3 \pmod 4\},\\
P_2&=&\{(v_1,v_2,v_3)\in R(N,8,7)-R_M(N,8,7)\mid v_1+v_3\equiv0 \pmod 4\},
\end{eqnarray*}
and
$$
\tau_1=\frac18\begin{pmatrix}4&8&4\\-5&2&5\\2&-4&6\end{pmatrix},
\quad \tau_2=\frac18\begin{pmatrix}4&8&-4\\-5&2&-5\\-2&4&6\end{pmatrix}.
$$
Then one may easily show that it satisfies all conditions in Theorem \ref{maintool} and the eigenvectors of $\tau_1$ and $\tau_2$ are $z_1=(1,0,1)$ and $z_2=(1,0,-1)$, respectively.   Therefore  $(S_{8,7}\cap Q(N)) - 15\mathbb{Z}^2\subset Q(M)$. Since $S_{40,23}\subset Q(\text{gen}(M))$, we have $S_{40,23}\subset Q(M)$. 
Note that if the equation $2X^2+5Y^2+40Z^2=40n+23$ has an integer solution $X,Y,Z$, then $X,Y$ are odd and $X\equiv \pm2 \pmod5$.  Hence the equation
$$
5(2x+1)^2+40y^2+2(10z-3)^2=40n+23
$$
has an integer solution for any non negative integer $n$, which implies that the ternary sum  $p_3(x)+p_4+2p_7(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(vi)} $p_3(x)+p_5(y)+p_7(z)$. Let
$$
M=\langle5\rangle\perp\begin{pmatrix}12&-6\\-6&18\end{pmatrix}, \quad N=\langle2, 15, 30\rangle.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$.  In this case, we have 
$$
R(N,4,3)-R_M(N,4,3)=\pm\{(0,1,0),(2,1,2)\}.
$$
 If we define $P_1=R(N,4,3)-R_M(N,4,3)$ and 
$\tau_1=\frac14\begin{pmatrix}1&0&15\\0&-4&0\\-1&0&1\end{pmatrix}$,  it satisfies all conditions in Theorem \ref{maintool}.
The eigenvector of $\tau_1$ is $z_1=(0,1,0)$ and $Q(0,1,0)=15$. Therefore $(S_{4,3}\cap Q(N)) - 15\mathbb{Z}^2\subset Q(M)$. Since $S_{120,47}\subset Q(\text{gen}(M))$, 
we have $S_{120,47}\subset Q(M)$.
Note that if  the equation
$$
3(Z-2X)^2+5Y^2+15Z^2=12X^2+5Y^2+18Z^2-12ZX=120n+47
$$
has an integer solution $X,Y,Z$, then $Z-2X\equiv Y\equiv Z\equiv 1 \pmod2$, $Y\not\equiv0 \pmod3$ and $Z-X\equiv \pm 2\pmod5$. Hence the equation
$$
15(2x-1)^2+5(6y-1)^2+3(10z-3)^2=120n+47
$$
has an integer solution for any non negative integer $n$, which implies that the ternary sum  $p_3(x)+p_5(y)+p_7(z)$ is universal over $\mathbb Z$ by (\ref{im}). 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(vii)} $p_3(x)+2p_5(y)+p_7(z)$. Let 
$$
M=\langle5\rangle\perp\begin{pmatrix}9&3\\3&21\end{pmatrix},\quad N=\begin{pmatrix}6&3\\3&9\end{pmatrix}\perp\langle20\rangle.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$. One may easily show by a direct computation that $N\prec_{15,11} M$.
Since $S_{60,26} \subset Q(\text{gen}(M))$, we have $S_{60,26}\subset Q(M)$. Now consider the equation
\begin{eqnarray*}
120n+52\!\!\!&=&\!\!\!3(Z-4X)^2+10Y^2+15Z^2\\ 
&=&\!\!\!48X^2+18Z^2+10Y^2-24XZ=f(X,Y,Z).
\end{eqnarray*}
Since $f$ is isometric to $2M$, the above equation has an integer solution $X,Y,Z$ for any non negative integer $n$. 
Furthermore, since $Z-4X\equiv Y\equiv Z\equiv 1 \pmod 2$, $Y\not\equiv 0 \pmod3$ and $Z-4X\equiv \pm 2 \pmod5$, the equation
$$
15(2x-1)^2+10(6y-1)^2+3(10z-3)^2=120n+52
$$
has an integer solution for any non negative integer $n$. Therefore the ternary sum $p_3(x)+2p_5(y)+p_7(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(viii)} $p_3(x)+p_7(y)+2p_7(z)$. Let 
$$
M=\begin{pmatrix}3&0&1\\0&5&0\\1&0&17\end{pmatrix},\quad N=\langle2, 5, 25\rangle.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$. One may easily show by  a direct computation that $N\prec_{8,0}M$.
Since $S_{40,32}\subset Q(\text{gen}(M))$, we have  $S_{40,32}\subset Q(M)$.
Now consider the equation
\begin{eqnarray*}
40n+32\!\!\!&=&\!\!\!(Y-5X)^2+2Y^2+5Z^2\\
&=&\!\!\!25X^2+3Y^2+5Z^2-10XY=f(X,Y,Z).
\end{eqnarray*}
Since $f$ is isometric to $M$, the above equation has an integer solution for any non negative integer $n$.
Therefore the equation $g(X,Y,Z)=X^2+2Y^2+5Z^2=40n+24$ has an integer solution $X,Y,Z$ with $X\equiv Y\pmod 5$. Furthermore all of $X,Y$ and $Z$ have same parity. 
Suppose that  $(x,y,z)=(a,b,c)$  is an integer solution of  $g(x,y,z)=40n+32$ such that  $a\equiv b \pmod 5$ and $a\equiv b\equiv c\equiv 0 \pmod2$. Then $a\equiv c \pmod4$ and there is another representation 
$$
g\left(\frac{-3a+2b+5c}{4},\frac{a-2b+5c}{4},\frac{-a-2b-c}{4}\right)=g(a,b,c)=40n+32
$$
 satisfying
$$
\frac{-3a+2b+5c}{4} \equiv \frac{a-2b+5c}{4} \pmod5.
$$
Since $\tau=\frac14\begin{pmatrix}-3&2&5\\1&-2&5\\-1&-2&-1\end{pmatrix}$  has an infinite order, there is a positive integer $m$ such that each component of the vector 
$\tau^m(a,b,c)=(a_m,b_m,c_m)$ is odd and $a_m \equiv b_m \pmod 5$, unless $(a,b,c)$ is not an eigenvector of $\tau$. Note that $(a,b,c)=(-2t,t,0)$ is an eigenvector of $\tau$ and
 $g(-2t,t,0)=6t^2\not\equiv 2 \pmod5$.  Hence  for any non negative integer $n$, $g(X,Y,Z)=40n+32$ has an integer solution $X,Y,Z$ such that  $X\equiv Y\pmod5$ and  all of $X,Y$ and $Z$ are odd. Therefore the equation
$$
5(2x-1)^2+(10y-3)^2+2(10z-3)^2=40n+32
$$
has an integer solution for any non negative integer $n$, which implies that  the ternary sum  $p_3(x)+p_7(y)+2p_7(z)$ is universal over $\mathbb Z$ by (\ref{im}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(ix)} $p_3(x)+2p_3(y)+2p_8(z)$. Let 
$$
M=\langle3, 6, 16\rangle,\quad N=\langle1\rangle\perp\begin{pmatrix}18&6\\6&18\end{pmatrix}.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$.  By a direct computation, we  may easily check that  $R(N,3,1)-R_M(N,3,1)=\pm\{(1,0,0)\}$.
If we define 
$$
P_1=\pm\{(1,0,0)\} \quad  \text{and} \quad \tau_1=\frac13\begin{pmatrix}3&0&0\\0&-2&-3\\0&3&0\end{pmatrix},
$$ 
 then it satisfies all conditions in Theorem \ref{maintool}. 
The eigenvector of $\tau_1$ is $z_1=(1,0,0)$ and $Q(1,0,0)=1$.  Since $S_{24,1} \subset Q(\gen(M))$, we have $S_{24,1}  \subset Q(M)$, unless $24n+1$ is not a square of an integer. 
Since $N$ is contained in the spinor genus of $M$ and $1$ is represented by $N$, every square of an integer that has a prime divisor bigger than $3$  is represented by both $M$ and $N$ by Lemma  \ref{spinor}. 
Therefore every integer of the form $24n+1$ for some positive integer $n$ is represented by $M$. 
If  the equation $3X^2+6Y^2+16Z^2=24n+25$ has an integer solution $X,Y,Z$,  then $X,Y$ are odd and $Z$ is not divisible by 3. Hence the equation
$$
3(2x-1)^2+6(2y-1)^2+16(3z-1)^2=24n+25
$$ 
 has an integer solution for any non negative integer $n$, which implies that the ternary sum  $p_3(x)+2p_3(y)+2p_8(z)$ is universal over $\mathbb Z$ by (\ref{im}).
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(x)} $p_3(x)+p_7(y)+p_8(z)$. Let
$$
M=\begin{pmatrix}6&3\\3&9\end{pmatrix}\perp\langle20\rangle, \quad N=\langle5\rangle\perp\begin{pmatrix}9&3\\3&21\end{pmatrix}.
$$
Note that $\text {gen}(M)=\{[M],[N]\}$. One may show by a direct computation that $N\prec_{30,11}M$. Since
$S_{60,41}\subset Q(\text{gen}(M))$, we  have $S_{60,41}\subset Q(M)$.
Hence the equation 
$$
120n+82=3(Y-2X)^2+15Y^2+40Z^2=12X^2+18Y^2+40Z^2-12XY
$$
has an integer solution $X,Y,Z$ for any non negative integer $n$. Since $Y-2X\equiv Y\equiv 1\pmod2$, $Y-2X\equiv \pm 2\pmod5$ and $Z\not\equiv 0 \pmod3$, the equation
$$
15(2x-1)^2+3(10y-3)^2+40(3z-1)^2=120n+82 
$$
has an integer solution for any non negative integer $n$. Therefore by (\ref{im}), the ternary sum  $p_3(x)+p_7(y)+p_8(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(xi)} $p_3(x)+2p_3(y)+p_9(z)$. Let 
$$
M=\langle1\rangle\perp\begin{pmatrix}21&14\\14&28\end{pmatrix},\quad N=\langle1, 7, 14\rangle,\quad N'=\langle2, 7, 7\rangle.
$$
Note that $\text{gen}(N)=\{[N],[N']\}$. One may easily show by a direct computation that $N'\prec_{8,6} N$. Since 
$S_{56,46}\subset Q(\text{gen}(N))$, we have $S_{56,46}\subset Q(N)$.
 Now, one may show by a direct computation that  
 $$
 R(N,8,6)-R_M(N,8,6)=\pm\{(0,0,1),(0,0,3),(4,4,1),(4,4,3)\}.
 $$
If we define $P_1= R(N,8,6)-R_M(N,8,6)$ and $\tau_1=\frac18\begin{pmatrix}1&21&0\\-3&1&0\\0&0&-8\end{pmatrix}$,  then it satisfies all conditions in Theorem \ref{maintool}. The eigenvector of $\tau_1$ is $z_1=(0,0,1)$ and $Q(0,0,1)=14$.  Since $(S_{8,6}\cap Q(N)) - 14\mathbb{Z}^2\subset Q(M)$ by Theorem \ref{maintool},  we have $S_{56,46} \subset Q(M)$.
Hence the equation
$$
56n+46=X^2+7(Z-2Y)^2+14Z^2=X^2+28Y^2+21Z^2-28YZ
$$
 has an integer solution $X,Y,Z$ for any non negative integer $n$.
Since $X\equiv Z-2Y\equiv Z\equiv 1\pmod2$ and $X\equiv \pm 2 \pmod7$, the equation
$$
7(2x-1)^2+14(2y-1)^2+(14z-5)^2=56n+46
$$
has an integer solution for any non negative integer $n$,  which implies that the ternary sum  $p_3(x)+2p_3(y)+p_9(z)$ is universal over $\mathbb Z$ by (\ref{im}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(xii)} $p_3(x)+p_4(y)+p_9(z)$. Let
$$
M=\begin{pmatrix}2&1\\1&4\end{pmatrix}\perp\langle28\rangle,\quad 
N= \begin{pmatrix}4&2&2\\2&8&1\\2&1&8\end{pmatrix}.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$. One may easily show by a direct computation that $N\prec_{4,0}M$. Since $S_{28,16}\subset Q(\text{gen}(M))$, we have $S_{28,16}\subset Q(M)$. 
 Hence the equation
$$
56n+32=(Y-2X)^2+7Y^2+56Z^2=4X^2+8Y^2+56Z^2-4XY
$$
has an integer solution for any non negative integer $n$. Therefore the equation $g(X,Y,Z)=X^2+7Y^2+56Z^2=56n+32$ has an integer solution $(a,b,c)$ with $a\equiv b \pmod2$. Suppose that  $(a,b,c)$ is an integer solution of  $g(x,y,z)=56n+32$  satisfying $a\equiv b\equiv 0 \pmod2$. Note that 
$$
g\left(\frac{a-2b}{2},\frac{a+2b}{2},c\right)=g(a,b,c)=56n+32.
$$
Since $\tau=\frac12\begin{pmatrix}1&-2&0\\1&2&0\\0&0&2\end{pmatrix}$ has an infinite order,  there is  a positive integer $m$ such that  $a_m \equiv b_m \equiv 1 \pmod 2$, where $\tau^m(a,b,c)=(a_m,b_m,c_m)$.
 Since $(0,0,t)$ is an eigenvector of $\tau$ and $g(0,0,t)=56t^2\equiv 0\pmod7$, the equation $g(X,Y,Z)=56n+32$ has an integer solution $X,Y,Z$ such that $X\equiv Y\equiv 1 \pmod2$ and $X\equiv \pm 2\pmod7$, for any non negative integer $n$. Hence the equation
$$
7(2x-1)+56y^2+(14z-5)^2=56n+32
$$
has an integer solution for any non negative integer $n$. Therefore by (\ref{im}), the ternary sum $p_3(x)+p_4(y)+p_9(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(xiii)} $p_3(x)+p_5(y)+2p_{9}(z)$.  This case is one of the most complicate one. Let
$$
M=\begin{pmatrix}13&1\\1&13\end{pmatrix}\perp\langle21\rangle,\quad
N=\begin{pmatrix}10&5&2\\5&13&1\\2&1&34\end{pmatrix}\quad
N'=\begin{pmatrix}10&4&-3\\4&10&3\\-3&3&45\end{pmatrix}.
$$
Note that $\text{gen}(M)=\{[M],[N],[N']\}$ and $S_{21,10} \subset Q(\gen(M))$. One may easily show that  $N'\prec_{21,10}N$. The set $R(N,21,10)-R_M(N,21,10)$ consists of $48$ vectors, which is the union of the following sets:
\begin{eqnarray*}
P_1&=&\pm \{v : v\equiv (4,0,17),  (10,0,11)\ (\text{mod }{21})\},\\
P_2&=&\pm\{v : v\equiv  (2,17,19), (5,11,16) \ (\text{mod }{21}) \},\\
P_3&=&\pm \{v : v\equiv (2,11,13), (5,17,1)\ (\text{mod }{21})\},\\
P_4&=&\pm\{v : v\equiv  (1,0,0), (1,12,9), (8,0,0), (8,12,9)\ (\text{mod }{21}) \},\\
\widetilde{P}_1&=&\pm \{v : v\equiv (2,9,1),(2,17,2),(4,12,8),(5,11,5),\\
& &\hskip 4.3cm(5,12,13),(10,9,20)\ (\text{mod }{21})\},\\
\widetilde{P}_2&=&\pm \{v : v\equiv (1,0,18), (1,4,1), (1,12,12), (2,0,13),\\
& &\hskip 1.52cm (5,0,1), (8,11,8), (8,12,12), (13,0,3)\ (\text{mod }{21})\}.\\
\end{eqnarray*}
We also define
$$
\begin{small}
\tau_1=\frac{1}{21}\begin{pmatrix}-14&-14&-35\\14&-7&14\\-7&-7&14\end{pmatrix},
\tau_2=\frac{1}{21}\begin{pmatrix}-21&-7&14\\6&-17&-2\\6&4&19\end{pmatrix},
\tau_3=\frac{1}{21}\begin{pmatrix}-15&-1&-34\\-6&1&34\\6&13&1\end{pmatrix},
\end{small}
$$
and
$$
\begin{small}
\tau_4=\frac{1}{21}\begin{pmatrix}-21&-21&0\\0&19&-16\\0&5&19\end{pmatrix}, \qquad
\tau_5=\frac{1}{21}\begin{pmatrix}-21&-21&0\\6&15&30\\6&-6&9\end{pmatrix}.
\end{small}
$$

Note that each $\tau_i$ satisfies the condition (i),(ii) of Theorem \ref{maintool}.
One may easily show that $P_1$ and $\tau_1$ satisfy the condition (iii) of Theorem \ref{maintool}.
For any $v\in P_2$, we may easily check that 
$\tau_2(v)\in N$ and if $\tau_2(v)\pmod{21} \not  \in R_M(N,21,10)$, then 
$$
\tau_1\tau_2(v)\in N\quad  \text{and}  \quad \tau_1\tau_2(v)\ (\text{mod }{21}) \in R_M(N,21,10)\cup P_2.
$$
For example, assume that $v=(v_1,v_2,v_3)\equiv (2,17,19) \pmod {21}$. Then $\tau_2(v)$ is either a good vector or congruent to $(19,4,19)$ modulo $21$. If the latter holds, then 
$\tau_1\tau_2(v)$ is either a good vector or congruent to $(2,17,19)$ modulo $21$. Note that the order of $\tau_1\tau_2$ is infinite. 

For any $v'\in P_3$,  one may easily check that $\tau_3(v')\in N$ and if $\tau_3(v')\pmod{21}\not\in R_M(N,21,10) \cup P_2$, then 
$$
\tau_1\tau_3(v')\in N \quad \text{and} \quad \tau_1\tau_3(v')\ (\text{mod }{21})\in R_M(N,21,10)\cup P_3.
$$  
Note that the order of $\tau_1 \tau_3$ is infinite. 
Furthermore, for any $v''\in P_4$, one may easily check  that 
$$
\tau_4(v'')\in N \quad \text{and} \quad \tau_4(v'')\ (\text{mod }{21})\in  R_M(N,21,10)\cup P_4 \cup \widetilde{P}_2.
$$
Note that  for any $\widetilde{v}_1\in \widetilde{P}_1$, 
$$
\tau_1(\widetilde{v}_1) \in N \quad \text{and} \quad \tau_1(\widetilde{v}_1) \ (\text{mod }{21})\in R_M(N,21,10)\cup P_2.
$$
If $\widetilde{v}_2\in\widetilde{P}_2$, then one of vectors in 
 $$
 \{\tau_1(\widetilde{v}_2),\tau_5(\widetilde{v}_2),\tau_1\tau_5(\widetilde{v}_2), \tau_1^2(\widetilde{v}_2), \tau_1^2\tau_5(\widetilde{v}_2)\}
 $$ 
 is contained both in $N$ and in $R_M(N,21,10)\cup P_3$ modulo $21$.  
Therefore, though the situation is slightly different from the theorem, we may still apply Theorem \ref{maintool} to this case. 

The primitive eigenvectors of $\tau_1,\tau_1\tau_2,\tau_1\tau_3$ and $\tau_4$ are $(-1,0,1),(-1,2,1),(5,-4,1)$ and $(1,0,0)$, respectively. Note that 
$$
Q(-1,0,1)=40, \  \  Q(-1,2,1)=76,  \  \  Q(5,-4,1)=304 \quad \text{and} \quad Q(1,0,0)=10.
$$ 
Therefore if $168n+10$ is not of the form $10t^2$ for some positive integer $t$, then $168n+10$ is represented by $M$.  
Assume that $168n+10=10t^2$ for some positive integer $t>1$.  Then $t$ has a prime divisor relatively prime to $2\cdot3\cdot7$.  
 Since $N,N'\in\text{spn}(M)$,  and both $N$ and $N'$ represent $10$, $M$ represents $10t^2$ by Lemma \ref{spinor}.
Therefore every integer of the form $168n+10$ for a positive integer $n$ is represented by $M$. Hence the equation
$$
168n+178=6X^2+7(2Y-X)^2+21Z^2=13X^2+28Y^2+21Z^2-28XY
$$
 has an integer solution $X,Y,Z$ for any non negative integer $n$.
Since $X\equiv 2Y-X\equiv Z\equiv 1 \pmod2$, $2Y-X\not\equiv0 \pmod3$ and $X\equiv \pm2 \pmod7$, the equation
$$
21(2x-1)^2+7(6y-1)^2+6(14z-5)^2=168n+178
$$
has an integer solution for any non negative integer $n$, which implies that  the ternary sum $p_3(x)+p_5(y)+2p_{9}(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(xiv)} $2p_3(x)+p_5(y)+p_9(z)$. Let
$$
M=\begin{pmatrix}5&1\\1&17\end{pmatrix}\perp\langle21\rangle, \quad N=\begin{pmatrix}12&0&6\\0&14&7\\6&7&17\end{pmatrix}, \quad N'=\begin{pmatrix}5&2\\2&5\end{pmatrix}\perp\langle84\rangle.
$$
Note that $\text{gen}(M)=\{[M],[N],[N']\}$. One may easily show by a direct computation that $N\prec_{21,20}M$ and $N'\prec_{21,20}M$. Since $S_{84,62}\subset Q(\text{gen}(M))$, we have $S_{84,62}\subset Q(M)$.
Now consider the equation
\begin{eqnarray*}
168n+124\!\!\!&=&\!\!\!3(Y-4X)^2+7Y^2+42Z^2\\
&=&\!\!\!48X^2+10Y^2+42Z^2-24XY=f(X,Y,Z).
\end{eqnarray*}
Since $f$ is isometric to $2M$, the above equation has an integer solution $X,Y,Z$ for any non negative integer $n$. Since $Y\equiv Y-4X \pmod 4$, $Y-4X$, $Y$ and $Z$ are all odd. Furthermore, $X\equiv \pm 2\pmod7$ and $Y\not\equiv 0 \pmod3$. Therefore the equation
$$
42(2x-1)^2+7(6y-1)^2+3(14z-5)^2=168n+124
$$
has an integer solution for any non negative integer $n$, which implies that the ternary sum $2p_3(x)+p_5(y)+p_9(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(xv)} $p_3(x)+p_3(y)+p_{12}(z)$.  Let
$$
M=\langle4, 5, 5\rangle,\quad N=\langle1, 5, 20\rangle.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$ and $S_{20,1} \subset Q(\gen(M))$.  The set $R(N,20,1)-R_M(N,20,1)$ consists of following vectors:
$$
\begin{array}{lllllll}
\hskip -0.7cm &\pm(1,0,0),&\pm(1,0,5),&\pm(1,0,10),&\pm(1,0,15), &\pm(1,10,0),&\pm(1,10,5),\\
\hskip -0.7cm &\pm(1,10,10),&\pm(1,10,15),&\pm(9,0,0),&\pm(9,0,5),&\pm(9,0,10),&\pm(9,0,15),\\
\hskip -0.7cm &\pm(9,10,0),&\pm(9,10,5),&\pm(9,10,10),&\pm(9,10,15).
\end{array}
$$
If we define $P_1=R(N,20,1)-R_M(N,20,1)$ and 
$\tau_1=\frac{1}{20}\begin{pmatrix}20&0&0\\0&-12&32\\0&-8&-12\end{pmatrix}$, then it satisfies all conditions in Theorem \ref{maintool}. 
The eigenvector of $\tau_1$ is $z_1=(1,0,0)$ and $Q(1,0,0)=1$. Therefore if $20n+1$ is not of the form $t^2$ for a positive integer $t$, then it is represented by $M$.
Since $N$ is contained in the spinor genus of $M$ and $1$ is represented by $N$, every square of an integer that has a prime divisor relatively prime to $10$  is represented by $M$ by Lemma \ref{spinor}.  Therefore every integer of the form $20n+1$ for a positive integer $n$ is represented by $M$. Now consider the equation 
\begin{eqnarray*}
40n+42\!\!\!&=&\!\!\!5(Y-2X)^2+5Y^2+8Z^2\\
&=&\!\!\!20X^2+10Y^2+8Z^2-20XY=f(X,Y,Z).
\end{eqnarray*}
Since $f$ is isometric to $2M$, the above equation has an integer solution $X,Y,Z$ for any non negative integer $n$.
Since $Y-2X\equiv Y\equiv Z\equiv 1 \pmod2$ and $Z\equiv\pm2\pmod5$, the equation
$$
5(2x-1)^2+5(2y-1)^2+8(5z-2)^2=40n+42
$$
has an integer solution for any non negative integer $n$, which implies that the ternary sum $p_3(x)+p_3(y)+p_{12}(z)$ is universal over $\mathbb Z$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(xvi)} $p_3(x)+2p_3(y)+p_{12}(z)$. Let 
$$
M=\langle5, 8, 10\rangle,\quad N=\langle2, 5, 40\rangle.
$$
Note that $\text{gen}(M)=\{[M],[N]\}$ and  $S_{40,7} \subset Q(\gen(M))$.   One may show by a direct computation that  $R(N,8,7)-R_M(N,8,7)$ consists of the following vectors:
$$
\begin{array}{lllllll}
&\pm(1,1,0),&\pm(1,1,4),&\pm(1,3,2),&\pm(1,3,6),&\pm(1,5,2),&\pm(1,5,6),\\
 &\pm(1,7,0),&\pm(1,7,4),&\pm(3,1,2),&\pm(3,1,6),&\pm(3,3,0),&\pm(3,3,4),\\
 &\pm(3,5,0),&\pm(3,5,4),&\pm(3,7,2),&\pm(3,7,6).
\end{array}
$$
Let
\begin{eqnarray*}
P_1\!\!\!&=&\!\!\!\{(v_1,v_2,v_3)\in R(N,8,7)-R_M(n,8,7)\mid v_1-v_2+2v_3\equiv0 \ (\text{mod } 8)\},\\
P_2\!\!\!&=&\!\!\!\{(v_1,v_2,v_3)\in R(N,8,7)-R_M(n,8,7)\mid v_1+v_2+2v_3\equiv0\ (\text{mod } 8)\},
\end{eqnarray*}
and
$$
\tau_1=\frac18\begin{pmatrix}2&-10&20\\-4&-4&-8\\-1&1&6\end{pmatrix}, \quad
\tau_2=\frac18\begin{pmatrix}2&10&20\\4&-4&8\\-1&-1&6\end{pmatrix}.
$$
Then one may easily show that  it satisfies all conditions in Theorem \ref{maintool}. The eigenvectors for $\tau_1, \tau_2$ are $z_1=(1,1,0)$ and $z_2=(1,-1,0)$, respectively and $Q(1,1,0)=Q(1,-1,0)=7$. Therefore if $40n+7$ is not of the form $7t^2$ for some positive integer $t$, then $40n+7$ is represented by $M$.


Assume that there is a positive integer $t>1$ such that $40n+7=7t^2$.  Then $t$ has a prime divisor relatively prime to $10$. 
Since $N\in\text{spn}(M)$  and $N$ represents $7$, $M$ represents $7t^2$ for any $t>1$ by Lemma \ref{spinor}.
Therefore every integer of the form $40n+7$ for a positive integer $n$ is represented by $M$. Hence the equation $5X^2+8Y^2+10Z^2=40n+47$ has an integer solution $X,Y,Z$ for any non negative integer $n$. Since $X\equiv Z\equiv 1 \pmod2$ and $Y\equiv \pm2\pmod 5$, the equation
$$
5(2x-1)^2+10(2y-1)^2+8(5z-2)^2=40n+47
$$
has an integer solution for any non negative integer $n$. Therefore the ternary sum  $p_3(x)+2p_3(y)+p_{12}(z)$ is universal over $\mathbb Z$ by (\ref{im}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\\
\\
\textbf{(xvii)} $p_3(x)+p_5(y)+p_{13}(z)$.  Let
$$
M=\begin{pmatrix}12&0&6\\0&44&22\\6&22&47\end{pmatrix},\quad N=\begin{pmatrix}15&6&3\\6&20&10\\3&10&71\end{pmatrix},\quad
N'=\begin{pmatrix}23&1&6\\1&23&6\\6&6&36\end{pmatrix}.
$$
Note that $\text{gen}(M)=\{[M],[N],[N']\}$ and $S_{264,23} \subset Q(\gen(M))$. One may easily show by a direct computation that $N'\prec_{12,11}N$. Note that
$R(N,12,11)-R_M(N,12,11)$ consists of following vectors:
$$
\begin{array}{lllllll}
&\pm(1,11,0),&\pm(2,0,1),&\pm(2,0,7),&\pm(2,1,11),&\pm(2,7,5),&\pm(3,2,0),\\
&\pm(3,10,0),&\pm(4,5,1),&\pm(4,6,5),&\pm(4,6,11),&\pm(4,11,7),&\pm(5,7,0).
\end{array}
$$
We define a partition of $R(N,12,11)-R_M(N,12,11)$ as follows: 
\begin{eqnarray*}
P_1\!\!\!&=&\!\!\!\{(v_1,v_2,v_3)\mid v_1+v_2+v_3\equiv\!0\ (\text{mod }12) \},\\
P_2\!\!\!&=&\!\!\!\{(v_1,v_2,v_3)\mid v_1+v_2+v_3\equiv2,4,8,10\ (\text{mod }12)\},\\
\widetilde{P}_1\!\!\!&=&\!\!\!\{(v_1,v_2,v_3)\mid v_1+v_2+v_3\equiv\!1 \ (\text{mod }2), \  \  v_2 \equiv 2 \ (\text{mod }4)\},\\
\widetilde{P}_2\!\!\!&=&\!\!\!\{(v_1,v_2,v_3)\mid v_1+v_2+v_3\equiv\!1\  (\text{mod }2), \  \  v_2 \equiv 0 \ (\text{mod }4)\}.
\end{eqnarray*}
We also define
$$
\begin{small}
\tau_1=\frac{1}{12}\begin{pmatrix}-2&-14&-14\\-10&2&2\\2&2&-10\end{pmatrix},
\tau_2=\frac{1}{12}\begin{pmatrix}-8&-14&-6\\4&4&24\\4&-2&-6\end{pmatrix},
\widetilde{\tau}_{1}=\frac{1}{12}\begin{pmatrix}-12&-6&-12\\0&6&24\\0&-6&0\end{pmatrix},
\end{small}
$$
and $\widetilde{\tau}_2=\widetilde{\tau}_1^2$.
Then one may easily show that it satisfies all conditions in Theorem \ref{maintool}.  
The eigenvectors for $\tau_1, \tau_2$ are $z_1=(-1,1,0)$ , $z_2=(-2,-1,1)$, respectively,  and $Q(z_1)=23$, $Q(z_2)=143$.
Therefore if $264n+23$ is not of the form $23t^2$ for a positive integer $t$, then $264n+23$ is represented by $M$. 


Assume that $264n+23=23t^2$ for some positive integer $t$ greater than $1$. Then $t$ has a prime divisor relatively prime to $2\cdot3\cdot11$.
Since $N,N'\in\text{spn}(M)$  and both $N$ and $N'$ represent $23$, $M$ represents $23t^2$ by Lemma \ref{spinor}.
Therefore every integer of the form $264n+23$ for a positive integer $n$ is represented by $M$. Hence the equation
$$
264n+287=3(Z-2X)^2+11(Z-2Y)^2+33Z^2=12X^2+44Y^2+33Z^2-12XZ-44YZ
$$
 has an integer solution $X,Y,Z$ for any non negative integer $n$. Since $Z-2X\equiv Z-2Y\equiv  Z\equiv 1\pmod2$, $Z-2X\equiv \pm2\pmod{11}$ and $Z-2Y\not\equiv0\pmod3$, the equation
$$
33(2x-1)^2+11(6y-1)^2+3(22z-9)^2=264n+287
$$ 
has an integer solution for any non negative integer $n$. Therefore the ternary sum $p_3(x)+p_5(y)+p_{13}(z)$ is universal over $\z$ by (\ref{im}).


\begin{thebibliography}{abcd}


\bibitem {bh}  J. W. Benham, and J. S.  Hsia,  {\em On spinor exceptional representations},  Nagoya Math. J.  \textbf{87}(1982), 247-260. 


\bibitem {fz} F. Ge and Z. W. Sun,
{\em On some universal sums of generalized polygonal numbers},
Colloq. Math. \textbf{145}(2016), 149-155.

\bibitem {gps} S. Guo, H. Pan and Z. W. Sun, 
{\em  Mixed sums of squares and triangular numbers {\rm (II)}},  
Integers \textbf{7}(2007), $\#$A56, 5pp (electronic).

\bibitem {jko} Jangwon Ju, Kyoungmin Kim and Beong-Kweon Oh, {\em Spinor representations of ternary quadratic forms}, submitted. 


\bibitem {ki} Y. Kitaoka, 
{\em Arithmetic of quadratic forms}, 
Cambridge University Press, 1993.

\bibitem {regular} B.-K. Oh, 
{\em Regular positive ternary quadratic forms}, 
Acta Arith. \textbf{147}(2011), 233-243. 

\bibitem {pentagonal}  B.-K. Oh, 
{\em Ternary universal sums of generalized pentagonal numbers},  
J. Korean Math. Soc. \textbf{48}(2011), 837-847.

\bibitem {os} B.-K. Oh and Z. W. Sun, 
{\em Mixed sums of squares and triangular numbers {\rm (III)}}, 
J. Number Theory \textbf{129}(2009), 964-969. 

\bibitem  {om} O. T. O'Meara, 
{\em Introduction to quadratic forms},
Springer Verlag, New York, 1963.

\bibitem {s1} Z. W. Sun, 
{\em Mixed sums of squares and triangular numbers}, Acta Arith.
\textbf{127}(2007), 103-113.  

\bibitem {s2} Z. W. Sun, 
{\em On universal sums of polygonal numbers}, 
Sci. China Math. \textbf{58}(2015), 1367-1396.


\end{thebibliography}
\end{document}










1612.01157.extracted_bib
{bh J. W. Benham, and J. S. Hsia, {\em On spinor exceptional representations, Nagoya Math. J. 87(1982), 247-260.
1612.01157.extracted_bib
{fz F. Ge and Z. W. Sun, {\em On some universal sums of generalized polygonal numbers, Colloq. Math. 145(2016), 149-155.
1612.01157.extracted_bib
{gps S. Guo, H. Pan and Z. W. Sun, {\em Mixed sums of squares and triangular numbers {\rm (II), Integers 7(2007), $\#$A56, 5pp (electronic).
1612.01157.extracted_bib
{jko Jangwon Ju, Kyoungmin Kim and Beong-Kweon Oh, {\em Spinor representations of ternary quadratic forms, submitted.
1612.01157.extracted_bib
{ki Y. Kitaoka, {\em Arithmetic of quadratic forms, Cambridge University Press, 1993.
1612.01157.extracted_bib
{regular B.-K. Oh, {\em Regular positive ternary quadratic forms, Acta Arith. 147(2011), 233-243.
1612.01157.extracted_bib
{pentagonal B.-K. Oh, {\em Ternary universal sums of generalized pentagonal numbers, J. Korean Math. Soc. 48(2011), 837-847.
1612.01157.extracted_bib
{os B.-K. Oh and Z. W. Sun, {\em Mixed sums of squares and triangular numbers {\rm (III), J. Number Theory 129(2009), 964-969.
1612.01157.extracted_bib
{om O. T. O'Meara, {\em Introduction to quadratic forms, Springer Verlag, New York, 1963.
1612.01157.extracted_bib
{s1 Z. W. Sun, {\em Mixed sums of squares and triangular numbers, Acta Arith. 127(2007), 103-113.
1612.01157.extracted_bib
{s2 Z. W. Sun, {\em On universal sums of polygonal numbers, Sci. China Math. 58(2015), 1367-1396.