\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\begin{center}
\vskip 1cm{\LARGE\bf Representation of Integers of the Form \\
\vskip .1in
$x^2+my^2-z^2$}
\vskip 1cm
\large
Supawadee Prugsapitak and Nattaporn Thongngam\\
Algebra and Applications Research Unit \\
Division of Computational Science \\
Faculty of Science \\
Prince of Songkla University\\
Hatyai, Songkhla 90110\\
Thailand \\
\href{mailto:supawadee.p@psu.ac.th}{\tt supawadee.p@psu.ac.th} \\
\href{mailto:6310220031@psu.ac.th}{\tt 6310220031@psu.ac.th}\\
\end{center}

\vskip .2 in

\begin{abstract}
Let $m$ be a positive integer. A positive integer $k$ is called $m$-special if every integer $n$ can be expressed as $n=x^2+my^2-kz^2$ for some nonzero integers $x,y$ and $z$. In this article, we show that $1$ is $m$-special if and only if $m$ is not divisible by $4$.
\end{abstract}

\section{Introduction}
\label{sec:introduction}

Representations of integers as sums of squares have a long history. Ramanujan \cite{SM4} proved that there exist $54$ quadruples $(a,b,c,d)$ with $1 \leq a \leq b \leq c \leq d$ such that every natural number $n$ is representable in the form $aw^2+bx^2+cy^2+dz^2$.  Panaitopol \cite{SM3} proved that there exists no triple $(a,b,c)$ with $1 \leq a \leq b \leq c$ such that every natural number is representable in the form $ax^2+by^2+cz^2$.  However, if we allow $c$ in the representation $ax^2+by^2+cz^2$ to be negative, then the representation is possible.  Nowicki \cite{SM1} showed that if all natural numbers are representable in the form $x^2+y^2-cz^2$, then $c$ is of the form $q$ or $2q$, where either $q=1$ or $q$ is a product of primes of the form $4m+1$. Lam \cite{SM2} proved its sufficiency.  In what follows, we are concerned with the problem of representing natural numbers $n$ in the form $n = x^2+my^2-z^2$ for a given positive integer 
$m$,
where $xyz \neq 0$.  We provide necessary and sufficient conditions for representing all integers $n$ in the form $x^2+my^2-z^2$ where $x,y$ and $z$ are nonzero.

\begin{definition}
A positive integer $k$ is {\it $m$-special\/} if for every integer $n$ there exist nonzero integers $x, y,$ and $z$ such that $n = x^2+my^2-kz^2$.
\end{definition}

Nowicki \cite{SM1} showed that $1$ is $1$-special, that is, for every integer $n$ there exist nonzero integers $x, y,$ and $z$ such that $n = x^2 + y^2-z^2$.  Nowicki \cite{SM1} and  Lam \cite{SM2} showed that $k$ is $1$-special if and only if $k$ is of the form $q$ or $2q$ where either $q=1$ or $q$ is a product of primes of the form $4m+1$.

\section{Main Results}
\label{sec:Main Results}

\begin{theorem}
Let $m$ be a positive integer. If $m$ is divisible by $4$, then $1$ is not $m$-special.
\end{theorem}
\begin{proof}
Let $m$ be a positive integer divisible by $4$. Assume that $1$ is $m$-special. Then there exist nonzero integers $x$, $y$, $z$ such that $x^2+my^2-z^2=2$. So we have
$x^2-z^2 \equiv 2$ (mod $4$). Since quadratic residues modulo $4$ are $0$ and $1$, it follows that $x^2-z^2 \equiv 0,1,3$ (mod $4$). This is a contradiction. Hence $1$ is not $m$-special.
\end{proof}
In 2015,  Nowicki \cite{SM1} showed that $1$ is $1$-special. 
\begin{lemma}\cite{SM1}\label{lem1}
 $1$ is $1$-special.
\end{lemma}

We present an elementary result. The following well-known lemma plays an important role in our main result. The proof is given in \cite[Theorem 3.18]{SM5}:

\begin{lemma}\label{integer}
Let $m$ be a rational number. Then $m$ is an integer if and only if $m^2$ is an integer.
\end{lemma}

\begin{theorem}
Let $m > 1$ be a positive integer . If $m$ is not divisible by $4$, then $1$ is $m$-special.
\end{theorem}
\begin{proof}
Let $m > 1$ be a positive integer not divisible by $4$.
We show that for any integers $n$ there exist nonzero integers $x,y$ and $z$ such that $n=x^2+my^2-z^2$, i.e., $x^2-z^2=(x-z)(x+z)=n-my^2$.
In each case, we provide a choice of nonzero integers $x,y$ and $z$.

\bigskip

\noindent \textbf{Case 1:} Suppose $n \equiv 0$ (mod $4$). Thus $n=4l$ for some integer $l$. 
If $l \neq 0$, then we choose
$$y=4l+2, \quad x=1+l-m(2l+1)^2, \quad z=-1+l-m(2l+1)^2. $$
Obviously, $y \neq 0$. We next show that $x$ and $z$ are nonzero. If $x=0$ or $z=0$, then $m(2l+1)^2=l+1$ or $m(2l+1)^2=l-1$ respectively. Since $m>1$, 
we have $l>0$ or $l>3$, respectively. Both cases imply that $m$ is not an integer, which is a contradiction.

\bigskip

\noindent \textbf{Case 2:} Suppose $n \equiv 1$ (mod $4$). Thus $n=4l+1$ for some integer $l$. In this case, we choose 
$$y=2(4l+1), \quad x=1+2l-2m(4l+1), \quad z=-2l-2m(4l+1).$$ 
Again, we have that $y \neq 0$. If $x=0$, then $1$ is divisible by $2$, which is a contradiction. If $z=0$, then $m^2(4l+1)^2=l^2$. Thus $m^2$ is not an integer for all $l\neq 0$. Then by Lemma \ref{integer}, we get that
$m$ is not an integer. Thus $x$ and $z$ are nonzero.

\bigskip

\noindent \textbf{Case 3:} Suppose $n \equiv 2 $ (mod $4$). Thus $n=4l+2$ for some integer $l$.

\bigskip

\noindent\textbf{Case 3.1:} Suppose $m \equiv 2 $ (mod $4$). Hence $m=4k+2$ for some non-negative integer $k$. We choose $$y=2l+1, \quad x=l-k-2kl+1, \quad z=-3l-k-2kl-1.$$ It is easy to see that $y\neq 0$. If $x=0$ or $z=0$, then $k=\frac{l+1}{2l+1}$ or $k=\frac{-(3l+1)}{2l+1} = -1-\frac{l}{2l+1}$ respectively. 
Since $k$ is an integer, we have $l=-1$ or $0$. Therefore $x$ or $z$ can be zeros only if $(m,n)=(2,-2), (6,2)$.
To handle these cases, we can use the representations 
\begin{align*}
    2 &= x^2+6y^2-z^2 \quad\text{where}\quad (x,y,z)= (12,3,14)\\
    -2 &= x^2+2y^2-z^2 \quad\text{where}\quad (x,y,z)= (4,3,6).
      \end{align*}


\noindent\textbf{Case 3.2:} Suppose $m \equiv 1 $ (mod $2$).  Therefore $m=2k+1$ for some positive integer $k$. Here we choose $$y=2l+1, \quad x=1-k-2kl, \quad z=-k-2l-2kl.$$ Since $y$ is odd, we have that $y$ is nonzero.
If $x=0$, then $l=0$ and $k=1$. We obtain $m=3$ and $n=2$. For this exceptional case, we use the representation $2=12^2+3(3)^2-13^2$. If $z=0$, then $k^2(1+2l)^2=(2l)^2$. Thus $k^2$
is not an integer for $l\neq 0$. Thus again by Lemma \ref{integer}, $k$ is not an integer for $l\neq 0$. 

\bigskip

\noindent \textbf{Case 4:}   Let $n \equiv 3 $ (mod $4$). Thus $n=4l+3$ for some integer $l$. We choose $$y=2(4l+3),\quad  x=2l-6m-8ml+2, \quad z=-2l-6m-8ml-1.$$ It is easy to see that $y$ and $z$ are nonzero. If $x=0$, then $m(4l+3)=l+1$. Since $m=\frac{l+1}{4l+3}>1$, we obtain that $l$ is not an integer which is a contradiction.

\end{proof}

In conclusion, we have proved the following theorem.
\begin{theorem}
Let $m$ be a positive integer.  Then $1$ is a $m$-special if and only if $m$ is not divisible by $4$.
\end{theorem}

\section{Acknowledgments}

We thank the referee for 
valuable comments and suggestions.




\begin{thebibliography}{9}
\bibitem{SM2} P. C. H. Lam, Representation of integers using {$a^2 + b^2 - dc^2$}, {\it J. Integer Sequences} {\bf 18} (2015),
\href{https://cs.uwaterloo.ca/journals/JIS/VOL18/Lam/lam2.html}{Article 15.8.6}.

\bibitem{SM1}A. Nowicki,
The numbers {$a^2+b^2-dc^2$}, {\it J. Integer Sequences} {\bf 18} (2015),
\href{https://cs.uwaterloo.ca/journals/JIS/VOL18/Nowicki/nowicki3.html}{Article 15.2.3}.

\bibitem{SM3} L. Panaitopol,  On the representation of natural numbers as sums of squares.  {\it Amer. Math. Monthly}, {\bf 112} (2005), 168--171.

\bibitem{SM4} S. Ramanujan,
On the expression of a number in the form {$ax^2+by^2+cz^2+dw^2$}, {\it Proc. Cambridge Philos. Soc.} {\bf 19} (1917), 11--21. Reprinted in
{\it Collected Papers of Srinivasa Ramanujan}, AMS Chelsea
Publishing, 2000, pp.~169--178.

\bibitem{SM5} 
K. H. Rosen, {\it Elementary Number Theory and its Applications},
5th edition, Pearson Education Inc. Press, 2005.

\end{thebibliography}

\bigskip
\hrule
\bigskip

\noindent 2010 {\it Mathematics Subject Classification}: Primary 11E25.

\noindent \emph{Keywords:} sum of squares.

\bigskip
\hrule
\bigskip


\vspace*{+.1in}
\noindent
Received  March 18 2021; 
revised versions received April 6 2021; July 10 2021.
Published in {\it Journal of Integer Sequences},  July 19 2021.



\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}
