\documentclass[12pt,one side]{report}

\usepackage{amssymb,amsmath,amsthm}

\usepackage{tikz}

\usepackage{color, soul}

\usepackage{float}

\usepackage{bm}

\usepackage{mathtools}

\usepackage{enumerate}

\usepackage{graphicx}

\usepackage[left=1.5in, top=1.3in, right=1.3in, bottom=1.2in]{geometry}

\usepackage{longtable}

\usepackage{cancel}

\usepackage{setspace}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{prop}[theorem]{Proposition}
\newtheorem{ax}[theorem]{Axiom}
\newtheorem{lem}[theorem]{Lemma}
\newtheorem{note}[theorem]{Note}
\newtheorem{defn}[theorem]{Definition}
\newtheorem{conj}[theorem]{Conjecture}
\newtheorem{ex}[theorem]{Example}
\newtheorem{rem}[theorem]{Remark}
\newtheorem{cor}[theorem]{Corollary}
\newtheorem{notation}[theorem]{Notation}

\everymath{\displaystyle}

\setlength{\parindent}{15pt}

\renewcommand{\baselinestretch}{2}

\begin{document}

\title{THE ENUMERATION PROBLEM ON NUMERICAL MONOIDS}
\author{CRAIG EDWARDS}
\date{05 2019}

\pagenumbering{roman}
{
{\singlespacing

\newpage
\thispagestyle{empty}
\begin{center}
{ %\large
UNIVERSITY OF OKLAHOMA
\par
\vspace{0.16in}
GRADUATE COLLEGE
\par
\vspace{1.2in}

THE ENUMERATION PROBLEM ON NUMERICAL MONOIDS
\par
\vspace{0.17in}
\par
\vspace{1.2in}

A DISSERTATION
\par
\vspace{0.17in}
SUBMITTED TO THE GRADUATE FACULTY
\par
\vspace{0.17in}
in partial fulfillment of the requirements for the
\par
\vspace{0.17in}
Degree of
\par
\vspace{0.17in}
DOCTOR OF PHILOSOPHY
\par
\vfill
By
\par
\vspace{0.17in}
CRAIG EDWARDS
\par
%\vspace{0.05in}
Norman, Oklahoma
\par
%\vspace{0.05in}
2019
}
\end{center}

\newpage
\thispagestyle{empty}
\begin{center}
	{
		
       \par
	   THE ENUMERATION PROBLEM ON NUMERICAL MONOIDS
		\par
		\vspace{0.9in}
		A DISSERTATION APPROVED FOR THE
		\par
		
		DEPARTMENT OF MATHEMATICS
		\par
		\vspace{1.2in}
		BY
		\par
		
		\vspace{1.2in}
		\begin{flushright}
			\begin{tabular}{cr}
				
				\  \  \  \  \  \  \  & Dr. Murad \"{O}zayd\i n, Chair \\
				\\ &  \\
				
				
				& Dr. Max Forester \\
				\\ & \\
				
				
				& Dr. Ralf Schmidt  \\
				\\   & \\
				
				
				& Dr. Kimball Martin  \\
				\\ &  \\
				
				
				& Dr. Joseph Havlicek \\
			\end{tabular}
		\end{flushright}
	}
\end{center}



\newpage
\thispagestyle{empty}
\   \
\par
\vfill
\begin{center}
\copyright \    Copyright by CRAIG EDWARDS \   2019

All rights reserved.
\end{center}
}

\chapter*{Acknowledgements}

The result of this work would not have been possible without the many people around me who have giving their support throughout this process.  First I would like to thank Dr. Murad \"{O}zayd\i n.  He has went above and beyond to help me whenever I needed it.  I can not count the number of hours and late nights we have spent working together on this research.  I would also like to thank Dr. Ralf Schmidt, Dr. Max Forester, Dr. Kimball Martin and Dr. Joseph Havlicek for serving on my doctoral committee.

To the mathematics department staff, thank you for taking care of all my needs and answering all my questions throughout my time at the University of Oklahoma. 

Next, I would like to thank my family who always pushed me to reach for the next goal and that anything was possible.  Finally, I would like to thank my wife, Cheryl, who has been so understanding of everything throughout this process.  It has been a long, difficult journey, but she never left my side.

{\doublespacing
\tableofcontents
%\listoffigures
}

\newpage
\chapter*{Abstract}
Even though the problem of counting points with integer coordinates on a (rational) polytope has connections to sophisticated mathematical topics like Algebraic K-Theory, Fourier-Dedekind Sums, Heegard-Floer Homology, Symplectic Geometry and more, the basic (open) problem(s) are easy to describe. For example the following has been an open problem for over 60 years: If a, b and c are coprime positive integers how many ways are there of obtaining a given natural number n as a sum of (nonnegative integer) multiples of a, b and c? The problem is giving an effective computable formula for this number f(n).   We are able to find this formula for a particular case.  Furthermore, we use a variety of techniques to find the secondary asymptotic in any case, along with an effective computable formula for the McNugget Monoid and a couple of infinite families.

\newpage
}
\pagenumbering{arabic}

\newpage

\chapter{Introduction}

If chicken McNuggets come in boxes of $6$, $9$ or $20$, what is the largest number of McNuggets that we can not get?  More generally, given $n$ coprime denominations, $a_1, a_2, \ldots, a_n$ (i.e. $\gcd (a_1, a_2, \ldots, a_n) = 1$), what is the the largest integer that can not be obtained as a sum of these (assuming an arbitrarily large supply of each)? This question is the Linear Diophantine Frobenius Problem (also referred to as the Frobenius coin exchange problem), named after Frobenius, who liked to ask this question in his lectures, in the late $1800$'s.  However he never published anything regarding it.  The first papers which referred to this as the Frobenius Problem were by Schur (a student of Frobenius) and Alfred Brauer (a student of Schur).  They also named the largest number not attainable the Frobenius number.  This question spawned other interesting, related questions:

\begin{itemize}
\item  Genus:  How many nonnegative integers can not be obtained?  For 2 denominations, this was solved in 1882 by Sylvester \cite{Sylvester}.  This may have lead Frobenius to formulate his problem.
\item  Enumeration:  For any $n \in \mathbb{N}$, how many ways can we express $n$ in terms of the generators?  Equivalently, the restricted partition problem: The number of partitions of $n$ using only parts corresponding to the given denominations.  This is the focus of this thesis. 
\end{itemize}

The mathematical context of these questions is based on the concept of a numerical monoid: a cofinite (i.e., with finite compliment) subset of natural numbers, containing $0$, which is closed under addition.  Cofiniteness is a consequence of the fact that the denominations are coprime.  \\

There are many other interesting related problems, such as the asymptotic distribution or the limit behavior of Frobenius numbers for 3 (or more) generators proposed by Arnold, see \cite{BourSin07}, \cite{JM10}.  These questions will not be addressed in this thesis. \\

%For our purposes, we will be looking at the Frobenius Problem using numerical monoids.  This is an algebraic structure which has finitely many generators and contains all positive linear combinations of the given generators.  One interesting characteristic that is not required in a numerical monoids is inverses.

The Enumeration Problem with $2$ generators $a$ and $b$, coprime positive integers, has a satisfactory solution given by the Popoviciu Theorem/Formula, for which we give a short geometric proof in Section 6.1:

\begin{center}  $\frac{n}{ab} - \left \{ \frac{tn}{a} \right \} - \left \{ \frac{sn}{b} \right \} + 1 $, \end{center}

\noindent{where $\{x \}$ is the fractional part of the real number $x$, and $s,t$ are integers such that $sa+tb = 1$.  This has been rediscovered several times in the literature, \cite{BR07}, \cite{BarPop}, \cite{SS98}, \cite{HT74}.  However, an analogous result for $3$ generators is not available.  The example of the McNugget monoid with generators $6,9$ and $20$ will be analyzed in Section 6.2.2 below.}  \\ %These denominations were introduced by Henri Picciotto, who thought about applying the Frobenius Problem to McDonald's Chicken McNuggets in the 1980's, and even referenced it in a textbook he co-authored. 

The modern approach to the Frobenius and the Genus Problems above is finding a short rational expression for the Hilbert series of the numerical monoid $M$:

\begin{center}  $H_M (z) := \sum_{m \in M} z^m$.  \end{center}
(This is the Hilbert function of the algebra of regular functions on the monomial curve corresponding to the monoid $M$.)  It is easy to see that $H_M (z)$ has a rational expression $\frac{P(z)}{1-z}$.  However, the number of terms of $P(z)$ is exponential the data (to be explained below).  So a modern solution to the Frobenius Problem involves making the denominator somewhat larger, while dramatically decreasing the number of terms of the numerator.   When $H_M (z) = \frac{P(z)}{Q(z)}$, the Frobenius number of $M$ is $\deg P - \deg Q$ and the genus of $M$ is $\lim_{z \longrightarrow 1} \left(\frac{1}{1-z} - H_M (z) \right)$, which can be computed by several applications of L'Hospital's rule.   \\ %Note that $H_M (z)$ is the Hilbert series of the algebra of regular functions of the monomial curve generated by 

A short rational expression for the Hilbert series of the monoid generated by coprime, positive integers $a,b$ and $c$ is given by the Morales-Denham formula below (Chapter 2) involving the positive integers $R_a, R_b$ and $R_c$ where $R_a$ is the smallest positive multiple of $a$ which can be expressed in terms of $b$ and $c$ (similarly, for $R_b$ and $R_c$), \cite{Den03}.  There are $3$ cases: %based on the smallest multiple of one generator in the numerical monoid generated by the other $2$.  For the numerical monoid $<a,b,c>$, this value would be denoted as $R_a a$, $R_b b$ or $R_c c$ depending on which generators multiple you are looking for.  Each case, along with its Hilbert series is as follows:

\begin{enumerate}[I.]
\item When $R_a a = R_b b = R_c c$, then
\begin{center}  $H_{<a,b,c>} (z) = \frac{1-2z^{R_a a} + z^{2R_a a}}{(1-z^a)(1-z^b)(1-z^c)}$  \end{center}
\item When $R_a a = R_b b \not= R_c c$, then
\begin{center}  $H_{<a,b,c>} (z) = \frac{1-z^{R_a a} - z^{R_c c} + z^{R_a a + R_c c}}{(1-z^a)(1-z^b)(1-z^c)}$\end{center}
\item When $R_a a$, $R_b b$, $R_c c$ are distinct, then
\begin{center}  $H_{<a,b,c>} (z) = \frac{1 - z^{R_a a} - z^{R_b b} - z^{R_c c} + z^{R_a a + s_{bc}c} + z^{R_c c + s_{ba}a}}{(1-z^a)(1-z^b)(1-z^c)}$,  \end{center}
where $s_{ba}, s_{bc}$, etc., are the (unique) natural numbers satisfying $R_a a = s_{ba} b + s_{ca} c$ and $R_c c = s_{ac} a + s_{bc} b$.
\end{enumerate}

An analogous formula for $4$ or more generators is not available.  In fact, there are numerical monoids, generated by $a,b,c$ and $d$, such that when the Hilbert series $H_M (z)=\frac{P(z)}{(1-z^a)(1-z^b)(1-z^c)(1-z^d)}$, the number of terms of $P(z)$ can be arbitrarily large. \\

%Note that the $R_a a = R_b c = R_c c$ is a special case of $R_a a = R_b b$ and hence both formulas are the same in this case.

If $f(n)$ is the answer to the Enumeration question (how many ways can we express $n$ as a sum of nonnegative multiples of the generators $a_1, a_2, \ldots, a_d$), then 
\begin{center}  $\sum_{n=0}^{\infty} f(n) z^n =  \frac{1}{(1-z^{a_1})(1-z^{a_2})\dots(1-z^{a_d})}$.  \end{center}

\noindent{Using partial fractions, we can obtain a formula for $f(n)$ in terms of Fourier-Dedekind sums.  This formula is useful for proving qualitative results like Ehrhart's Theorem stating that $f(n)$ is a \textit{quasi-polynomial} in $n$ (the coefficient are not constant, but periodic functions of $n$).  However, this sum is not effectively computable because it has $a_1 + a_2 + \dots + a_d$ terms, which is exponential in the data: the number of bits needed to express $a_1, a_2, \ldots, a_d$ is $\log_2 (a_1 a_2 \dots a_d)$.} \\

%When looking for the number of ways to write a given $n$ in terms of the generators of a monoid $M = <a_1, a_2, \ldots, a_d>$, generating functions will be a valuable tool, as we can write short rational expressions corresponding to each generator and manipulate the product of these algebraically.  In our case, we specifically use partial fractions as a way of investigating a monoid with $3$ generators $<a,b,c>$.

An algebraic/combinatorial approach to counting integer lattice points in polyhedra is provided by the theorems of Brion and Lawrence-Varchenko, \cite{BHS}, utilizing multivariable generating functions. In Chapter 4, we give a short geometric proof of these in 2 dimensions (the case that we use).  We use these, partial fraction expansions (Chapter 5) and properties of the Discrete Fourier Transform (reviewed in Chapter 3), after applying a suitable geometric transformation.  For instance, for the numerical monoid $<a,b,c>$, generated by coprime positive integers $a,b$ and $c$, the Enumeration problem is equivalent to counting the integer lattice points on a rational triangle $P$ scaled by $n$, in the plane:  $f(n) = | n P \cap \mathbb{Z}^2 |$. \\

If the vertices of $P$ have integers coordinates then Pick's Theorem would provide the answer:  $| nP \cap \mathbb{Z}^2 | = \text{ Area} (P) n^2 + \frac{1}{2} | \partial P \cap \mathbb{Z} | n + 1$.  This is the Ehrhart polynomial of $P$.  Our geometric interpretation of the coefficients is that the leading coefficient of $f(n)$ is the \textit{latticial area} while the linear coefficient is the \textit{latticial length} of the boundary $\partial P$.  These are the first two instances of the latticial measures we define in 2.1 below.  They are some of the relevant invariants under the action of the group $\mathbb{Z}^d \rtimes GL_d ( \mathbb{Z} )$. \\

When the vertices have rational, but not integer, coordinates (which is always the case for the Enumeration Problem unless all the generators equal $1$), other invariants (of pairs of faces of consecutive dimensions), which we call \textit{margins} (see 2.1), are also relevant.  This is already apparent in Popoviciu's Formula where the margins of the endpoints are $\left \{\frac{tn}{a} \right \}$ and $\left \{ \frac{sn}{b} \right \}$, giving the latticial distance from an endpoint to the nearest lattice point. \\

For example, via our geometric transformation, the McNugget Enumeration problem $f(n)$ is equivalent to the problem of counting points with integer coordinates (i.e., lattice points) in the unshaded triangle below in the plane (see Chapter 6).

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0.3) -- (10,0.3);
\draw [->] (0.5,-1) -- (0.5,4);
\draw[thick] (9,0) -- (4.5,0) node [below] {$\frac{n}{18}$};
\draw[thick] (4.5,0) -- (0,0) node [below left] {$\left( - \left \{ \frac{n}{2} \right \}, - \left \{ \frac{2n}{3} \right \} \right)$};
\draw[thick] (0,0) -- (0,1.5) node [left] {$\frac{n}{60}$};
\draw[thick] (0,1.5) -- (0,3);
\draw[thick] (0,3) -- (4.5,1.5);
\draw[thick] (4.5,1.5) -- (9,0);
\draw[black][fill=gray] (0,0) -- (9,0) -- (8.1,0.3) -- (0.5,0.3) -- (0.5,2.8333333) -- (0,3) -- (0,0);
\draw[dashed] (0,0.3) -- (0.5, 0.3);
\draw[dashed] (0.5, 0.3) -- (0.5, 0);
\end{tikzpicture}
\end{center}
\end{figure}

\noindent{Here the latticial lengths of the sides are $\frac{n}{18}$, $\frac{n}{60}$ and $\frac{n}{180}$ (for the hypotenuse).  The margins of the sides are $\left \{ \frac{2n}{3} \right \}$, $\left \{ \frac{n}{2} \right \}$ and $0$.  In general, the latticial lengths of the side corresponding to the generators $a$ and $b$ is $\frac{n}{\text{lcm}(a,b)}$ and its margin is $\left \{ \frac{sn}{\gcd(a,b)} \right \}$ where $s$ is the multiplicative inverse of $c$ modulo $\gcd(a,b)$.} \\

For the McNugget Problem, for instance, $f(99) = 8, f (100) =7$.

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}[scale=0.7]
\draw [->] (-1,0.3) -- (9,0.3);
\draw [->] (0.5,-1) -- (0.5,3);
\draw[thick] (8.1,0.3) -- (4.5,0.3) node [below] {$\frac{11}{2}$};
\draw[thick] (4.5,0.3) -- (0,0.3) node [below left] {$\left( - \left \{ \frac{99}{2} \right \}, - \left \{ \frac{198}{3} \right \} \right) = \left( -\frac{1}{2}, 0 \right)$};
\draw[thick] (0,0.3) -- (0,1.5) node [left] {$\frac{33}{20}$};
\draw[thick] (0,1.5) -- (0,3);
\draw[thick] (0,3) -- (8.1,0.3);
\draw[black][fill=gray] (0,0.3) -- (0.5,0.3) -- (0.5,2.8333333) -- (0,3);
\draw (-5,2) node {$\mathbf{n = 99}$};
\filldraw 
(0.5,0.3) circle (2pt)
(0.5,1.94) circle (2pt)
(2.02,0.3) circle (2pt)
(2.02,1.94) circle (2pt)
(3.52,0.3) circle (2pt)
(5.02,0.3) circle (2pt)
(6.52,0.3) circle (2pt)
(8.02,0.3) circle (2pt);
\end{tikzpicture}
\end{center}
\end{figure}

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}[scale=0.7]
\draw [->] (-1,0.3) -- (9,0.3);
\draw [->] (0.5,-1) -- (0.5,3);
\draw[thick] (9,0) -- (4.5,0) node [below] {$\frac{50}{9}$};
\draw[thick] (4.5,0) -- (0.5,0) node [below left] {$\left( - \left \{ \frac{100}{2} \right \}, - \left \{ \frac{200}{3} \right \} \right) = \left( 0, - \frac{2}{3} \right)$};
\draw[thick] (0.5,0) -- (0.5,1.5) node [left] {$\frac{5}{3}$};
\draw[thick] (0.5,1.5) -- (0.5,2.85);
\draw[thick] (0.5,2.85) -- (9,0);
\draw[black][fill=gray] (0.5, 0) -- (9,0) -- (8.1,0.3) -- (0.5,0.3);
\draw (-5,2) node {$\mathbf{n = 100}$};
\filldraw 
(0.5,2.85) circle (2pt)
(0.5,0.3) circle (2pt)
(1.868,0.3) circle (2pt)
(3.236,0.3) circle (2pt)
(4.604,0.3) circle (2pt)
(5.972,0.3) circle (2pt)
(7.34,0.3) circle (2pt);


\end{tikzpicture}
\end{center}
\end{figure}









%Another perspective that we can take when looking for the number of ways to write a given $n$ is from a geometric perspective.  When looking at a monoid with $3$ generators, this corresponds to a triangle in the $x,y,z$-space, located in the first octant.  We can then transform this triangle into $2$-dimensions and then use cones at each vertex of the triangle to count the number of lattice points in the triangle, using either the Brion or Lawrence-Varchenko Theorems.

The goal for this research is to find an effectively computable closed formula for the monoid $<a,b,c>$, which is better than the Fourier Dedekind Sum formula.  By better, we mean a formula which is not exponential in the data.  Ideally, a formula with a bounded number of terms, independent of the size of the generators $a,b$ and $c$.  There is currently an algorithm which is polynomial in the data, by Barvinok \cite{Bar94}, in particular the number of steps grows with the size of the generators $a,b$ and $c$; it is not bounded by an absolute constant.

\noindent{We achieve this for Case I when $R_a a = R_b b = R_c c$:}

\begin{center}
$f(n) = \frac{n^2}{2abc} + \frac{3 - 2\alpha (n)}{2R_a R_b R_c} n + \frac{(2 - \alpha (n)) (1 - \alpha (n))}{2}$,
\end{center}
where $\alpha (n) := \left \{ \frac{n}{R_a} \right \} + \left \{ \frac{n}{R_b} \right \} + \left \{ \frac{n}{R_c} \right \}$.  We do not have an analogous solution for Cases II and III in general.  We can do this for some infinite families, for instance, in 6.3.2 and 6.3.3 below.  We also discuss the McNugget monoid in detail in 6.2.2 below. \\

Focusing on a numerical monoid $M$ with generators $a,b$ and $c$ it is well known that $f_M (n) - \frac{n^2}{2abc}$ is $O(n)$, that is, the quadratic quasi-polynomial $f_M (n)$ has $\frac{1}{2abc}$ as its leading coefficient.  (When $M$ has generators $a_1, a_2, \ldots, a_k$ the leading term is $\frac{n^k}{(k-1)!a_1 a_2 \dots a_k}$.)  In Section 5.3 below we find the secondary asymptote, i.e., the (periodic) coefficient of $n$:

\begin{center}  $\frac{Aa + Bb + Cc - 2Aa \left \{ \frac{s_1 n}{A} \right \} - 2Bb \left \{ \frac{s_2 n}{B} \right \} - 2Cc \left \{ \frac{s_3 n}{C} \right \}}{2abc}$,  \end{center}

\noindent{where $\gcd (a,b) = C$, $\gcd (a,c) = B$, $\gcd (b,c) = A$ and $s_1 a + s_2 b + s_3 c = 1$}. In Chapter 7, we conjecture that a similar formula is valid for an arbitrary polytope in any dimension.




%We do have a satisfactory expression for the secondary asymptote.  For $3$ generators, this is the coefficient of $n$ in the quasi-polynomial $f(n)$.  This is also an expression with a bounded number of terms, independent of the sizes of $a,b$ and $c$ (see \hl{5.1} below).  The coefficient of $n^2$ (which is the primary asymptote) is well known: $\frac{n^2}{2abc}$.  
 %we have a bounded formula for the secondary asymptotic of $f(n)$ in any case, which is independent of the size of the data, where $f(n)$ is a quasi-quadratic formula which counts the number of ways to write $n$ in terms of $a,b,c$.

\newpage

\chapter{Basic Information} %Notation, Terminology, Preliminaries

\section{Notation, Terminology, etc.}

Throughout this paper, we will be considering sets of the following type:

\begin{defn}

A \underline{\bf{monoid}} is a set that is closed under an associative binary operation and has an identity element $I \in S$.  Note that unlike a group, its elements need not have inverses.  Another term that is used is semigroup, but when doing so, the statement about inverses is understood.

\end{defn}

\begin{defn}

A \underline{\bf{numerical monoid}} is a set $M \subseteq \mathbb{N}$ such that 
\begin{enumerate}
\item  $M$ is closed under addition
\item  $\mathbb{N} \setminus M$ is finite
\item  $0 \in M$
\end{enumerate}
\end{defn}

\noindent{Next note the following two facts about numerical monoids and their generators.}

%Note that any numerical monoid, $M$, is finitely generated with a unique minimal set of generators $0<a_1<a_2< \dots <a_d$ where $a_1 = \min \{ a \in M \mid a>0 \}$ and $a_k = \min \{ a \in M \mid a \notin <a_1, a_2, \ldots, a_{k-1}> \}$ as long as $<a_1, a_2, \ldots, a_{k-1}> \not= M$.  Since $a_i$'s are in different congruence classes $\mod a_1$, then we see that $d \le a_1$.}  On the other hand, a set $\{ a_1, a_2, \ldots, a_d \}$ of coprime positive integers generates a numerical monoid, however, we do not assume that this is a unique minimal set of generators. 

\begin{lem}
A set $\{ a_1, a_2, \ldots a_d \}$, of coprime positive integers generate a numerical monoid (we do not assume that this is the unique minimal set of generators).
\end{lem}

\begin{lem}
Any numerical monoid is finitely generated with a unique minimal set of generators $<a_1, a_2, \ldots, a_d>$ where $a_1 = \min \{a \in M \mid a>0 \}$ and $a_k = \min \{ a \in M \mid a \notin <a_1, a_2, \ldots, a_{k-1}> \}$.  Since $a_i$'s are in different congruence classes $\mod a_1$ we see that $d \le a_1$.
\end{lem}

%\begin{proof}
%\hl{******Provide Proof of this lemme here*******}
%\end{proof}

\noindent{Now lets define some characteristics, to a given numerical monoid $M$, or its compliment in $\mathbb{N}$:}

\begin{defn}
Given a monoid $M= <a_1, a_2, \ldots, a_d>$, any number $a \in \mathbb{N}$ such that $a \notin M$ will be referred to as a {\underline{\bf{gap}}}.  The {\underline{\bf{Frobenius Number}}} is the largest gap, that is the largest integer not in $M$.  The total number of gaps is called the {\underline{\bf{genus}}} of $M$.
\end{defn}

\begin{defn}
The {\underline{\bf{generating function}}} of the sequence $b_0, b_1, \ldots$ is the formal power series
\begin{center}  $f(z) = \sum_{n=0}^{\infty} b_n z^n$.  \end{center}
The generating function of the monoid $M= <a_1, a_2, \ldots a_d>$ is: 

\begin{center}  $F_M (z) = \sum_{n=0}^{\infty} f_M (n) z^n = \frac{1}{(1-z^{a_1})(1-z^{a_2})\dots(1-z^{a_d})}$, \end{center}
(when order does not matter) where $f_M (n)$ is the number of ways to obtain $n$ as a linear combination of $a_1, a_2, \ldots, a_d$, with nonnegative integer coefficients.
\end{defn}

\begin{defn}
Given a monoid $M$, the {\underline{\bf{Hilbert series}}} of $M$, denoted as $H_M (z)$ is defined as 
\begin{center}  $H_M (z) = \sum_{m \in M} z^m$.  \end{center}
An example of this is if $M = \mathbb{N}$, then 
\begin{center}  $H_{\mathbb{N}} (z) = 1 + z + z^2 + \dots = \frac{1}{1-z}$.  \end{center}

%Given a finitely generated $\mathbb{Z}$-graded module $M$ over a graded ring $R$, define the Hilbert function of $M$ as the map $H(M,i) : \mathbb{Z} \longrightarrow \mathbb{Z}$ such that, for all $a \in \mathbb{Z}$,
%\begin{center}  $H(M,a) = L(M_a)$,  \end{center}
%where $L$ denotes the length.  If $n$ is the dimension of $M$, then there exists a polynomial $P_M (x)$ of degree $n$ with rational coefficients, called the Hilbert polynomial of $M$) such that $P_M (a) = H(M,a)$ for all sufficiently large $a$.  The power series
%\begin{center}  $H_M (t) = \sum_{a \in \mathbb{Z}} H(M,a) t^a$  \end{center}
%is called the {\underline{\bf{Hilbert series}}} of $M$.  It is a rational function that can be written in a unique way in the form
%\begin{center}  $H_M (t) = \frac{Q_M (t)}{(1-t)^d}$,  \end{center}
%where $Q_M (t)$ is a linear combination with integer coefficients of powers of $t$ and $t^{-1}$.  If $M$ is positively graded, i.e. $M_a = 0$ for all $a < 0$, then $Q_M (t)$ is an ordinary polynomial with integer coefficients in the variable $t$.  If moreover $\dim (M) = 0$, then $H_M (t) = Q_M (t)$, i.e. the Hilbert series is a polynomial.  \hl{Ask Dr. Ozaydin about this definition.}
\end{defn}

%\begin{center}  $f_M (n) = \left | \left \{ z \begin{bmatrix}
 % -\frac{sn}{b}  \\
  %n
%\end{bmatrix} + (1-z) \begin{bmatrix}
  %\frac{tn}{a}  \\
  %n
%\end{bmatrix} \in \mathbb{R}^2 \mid 0 \le z \le 1 \right \} \cap \mathbb{Z}^2 \right | $ \end{center}

In later chapters, we will be using linear transformations in an effort to move triangles from a $3$-space ($x,y,z$-plane) into a $2$-space ($u,v,w$-plane, however $w=n$, a constant).   Before we describe the specific transformation that we will use, we need to provide some notation:

\begin{notation}

For the numerical monoid $<a_1, a_2, \ldots a_d >$, let $R_i a_i$ denote that smallest positive multiple of $a_i$ which is in $<a_1, a_2, \ldots, a_{i-1}, a_{i+1}, \ldots, a_d >$, for all $1 \le i \le d$.  Note that when $a_1, a_2, \ldots a_d$ are coprime, then the $R_i$'s have to be pairwise coprime.

\end{notation}

\noindent{Now we can define the relations and matrix used in our linear transformation:}

\begin{defn}

Given $a,b,c \in \mathbb{Z}$, the {\underline{\bf{Johnson relations}}} (Selmer Johnson $1960$) are as follows:

\begin{center}
\begin{tabular}{r c l c r c l}
$R_a a$ & $=$ & $s_{ab} b + s_{ac} c$ &or& $0$ & $=$ & $-R_a a + s_{ab} b + s_{ac} c$ \\
$R_b b$ & $=$ & $s_{ba} a + s_{bc} c$ &or& $0$ & $=$ & $-R_b b + s_{ba} a + s_{bc} c$ \\
$R_c c$ & $=$ & $s_{ca} a + s_{cb} b$ &or& $0$ & $=$ & $-R_c c + s_{ca} a + s_{cb} b$
\end{tabular}
\end{center}
where $s_{ab}, s_{ac}, s_{ba}, s_{bc}, s_{ca}, s_{cb}$ are in $\mathbb{N}$.  If we make these coefficients the entries of columns in a matrix, we get the following $3 \times 3$ matrix, which will be referred to as the {\underline{\bf{Johnson Matrix}}}, and computation:

\begin{center}
$\begin{bmatrix}
  a & b & c
\end{bmatrix}
\begin{bmatrix}
  -R_a & s_{ba} & s_{ca} \\
  s_{ab} & -R_b & s_{cb} \\
  s_{ac} & s_{bc} & -R_c
\end{bmatrix}
=\begin{bmatrix}
  0 & 0 & 0
\end{bmatrix}$
\end{center}
\end{defn}
\noindent{We will be using matrices similar to the Johnson Matrices.  To construct a matrix for a {\underline{\bf{Johnson Transformation}}}, we need to consider any $2$ (distinct) Johnson relations along with the following equation:}

\begin{center}  $t_a a + t_b b + t_c c = \gcd (a,b,c)$  \end{center}
where $t_a, t_b, t_c$ are in $\mathbb{Z}$. We will use the coefficients of these three equations to create the following $3 \times 3$ matrix, which we will denote as $A$:

\begin{center} $A = \begin{bmatrix}
  -R_a & s_{ba} & t_a \\
  s_{ab} & -R_b & t_b \\
  s_{ac} & s_{bc} & t_c
\end{bmatrix}$,  \end{center}
such that

\begin{center}
$\begin{bmatrix}
  x \\
  y \\
  z
\end{bmatrix}
= A \begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix}$,
\end{center}

\noindent{where $u,v,w$ are the new coordinates for $\mathbb{R}^3$.}  \\%referred to as the {\underline{\bf{Johnson Transformation}}}.} \\

Which matrix set up we will be using will depend upon which of the following $3$ possibilities is applicable:

\begin{enumerate}
\item  $R_a a, R_b b$ and $R_c c$ are all distinct,
\item  two of these products are equal, for example $R_a a = R_b b \not= R_c c$, or
\item  $R_a a = R_b b = R_c c$.
\end{enumerate}

The following as a well-known result which answers the topic of this paper for a $1$-dimensional polytope (a line segment or edge) in $2$-space:

\begin{theorem}[Pick's Theorem]
Given a polygon, $P$, whose vertices are lattice points, if we denote the number of lattice points on the boundary of $P$ as $| \partial P \cap \mathbb{Z}^2 |$ and the number of lattice points on the interior of $P$ as $| \mathring P \cap \mathbb{Z}^2 |$, then we have that
\begin{center}  Area$(P) =  | \mathring P \cap \mathbb{Z}^2 | + \frac{1}{2} | \partial P \cap \mathbb{Z}^2 | - 1$. \end{center}
\end{theorem}

\begin{note}
For the purposes of this topic, we will be considering a altered form of Pick's Thoerem, which writes the number of lattice points in a given polytope in terms of its area and the lattice points on its boundary:
\begin{center}
\begin{tabular}{r c l}
 Area$(P)$ & $=$ & $| \mathring P \cap \mathbb{Z}^2 | + \frac{1}{2} | \partial P \cap \mathbb{Z}^2 | - 1$ \\
 Area$(P)$ & $=$ & $| P \cap \mathbb{Z}^2 | -  \frac{1}{2} | \partial P \cap \mathbb{Z}^2 | - 1$ \\
 Area$(P) +  \frac{1}{2} | \partial P \cap \mathbb{Z}^2 | + 1$ & $=$ & $| P \cap \mathbb{Z}^2 |$
\end{tabular}
\end{center}
\end{note}

Since we will be counting lattice points in a polytope, we will be utilizing a length/measure which is not the Euclidean length/measure.  It is defined as follows:

\begin{defn}
%The {\underline{\bf{latticial length}}} of a line segment is equal to the number of lattice points on the line segment minus 1.  Similarly, the {\underline{\bf{latticial area}}} ({\underline{\bf{latticial volume}}}, ect.) of a polytope (polyhedron, ect.) is equal to the number of lattice points in the polytope (polyhedron, ect.

Let $P$ be a $k$-dimensional compact polytope.  It's $k$-dimensional {\underline{\bf{latticial}}}  {\underline{\bf{measure}}}, $\mu_{\mathbb{Z}}^k$ is

\begin{center}  $\mu_{\mathbb{Z}}^k (P) = \lim_{n \rightarrow \infty} \frac{1}{n^k} \mid P \cap \frac{1}{n} \mathbb{Z}^d \mid = \lim_{n \rightarrow \infty} \frac{1}{n^k} \mid nP \cap \mathbb{Z}^d \mid$. \end{center}

\end{defn}

\noindent{Note that this is also the leading term of the Ehrhart quasi-polynomial as} 
\begin{center}  Eh$(k) = \mid kP \cap \mathbb{Z}^d \mid = \mu_{\mathbb{Z}}^k (P) n^k + \dots$.  \end{center}

\begin{defn}
Given a polytope, $P$, the pair $F \subset G$, which are $k$ and $k+1$ dimensional faces of $P$, respectively, have an associated {\underline{\bf{margin}}} in $[0,1)$ which is 
\begin{center}  $\min \{ \mu_{\mathbb{Z}}^1 (x,y) \mid x \in F, y \in \overline{G} \cap \mathbb{Z}^d \}$.  \end{center} 
\end{defn} 

\noindent{Note that there is an element of $H = \mathbb{Z}^d \rtimes GL_d (\mathbb{Z})$ which will send $\overline{F}$ and $G$ into $k$ and $k+1$ dimensional flats parallel to coordinate subspaces.  Since $H$ preserves all latticial measures and margins, the margin of $F$ in $G$ now is the Euclidian distance between $F$ and $\overline{G} \cap \mathbb{Z}$.}

\begin{defn}
A {\underline{\bf{polyhedron}}} (in the Euclidean space $\mathbb{R}^d$) is the intersection of finitely many closed half spaces (given by linear inequalities).
\end{defn}

\begin{defn}
A {\underline{\bf{polytope}}} is the convex hull of finitely many points $\{v_0, v_1,$ $\ldots, v_k \}$, denoted hull$\{ v_0, v_1, \dots v_k \}$ in $\mathbb{R}^d$, equilvalently it is a compact polyhedron (by Fourier-Motzkin elimination \cite{NL10}), where
\begin{center}
\begin{tabular}{r c l}  
hull$\{ v_0, v_1, \ldots, v_k \}$ & $=$ & $\left \{ \sum t_i v_i \mid t_i \ge 0, \sum t_i = 1 \right \}$ \\
& $\subset$ & flat$\{ v_0, v_1, \ldots v_k \}$ \\
where flat$\{ v_0, v_1, \ldots v_k \}$ & $:=$ & $\left \{  \sum t_i v_i \mid \sum t_i = 1 \right \}$
\end{tabular} 
\end{center}
\end{defn}

Note the following:

\begin{itemize}
\item  $\hat{\text{hull}}\{ v_0, v_1, \ldots v_k \} :=$ flat$\{ v_0, v_1, \ldots v_k \}$
\item  flat$\{ v_0, v_1, \ldots v_k \} = v_0 +$ span$\{ v_1 - v_0, v_2 - v_0, \ldots v_k - v_0 \}$
\item dim hull$\{ v_0, v_1, \ldots v_k \} :=$ dim flat$\{ v_0, v_1, \ldots v_k \}$ = dim span$\{ v_1 - v_0, v_2 - v_0, \ldots v_k - v_0 \}$
\end{itemize}

\begin{defn}
A {\underline{\bf{rational polyhedron}}} is given by linear inequalities with integer coefficients.
\end{defn}

\begin{defn}
Given a rational polytope $P$, a $k$-dimensional face $F$ of $P$ is called {\underline{\bf{latticial}}} if the $k$-space $F$ is contained in, also contains (infinitely many) lattice points, i.e. if $F \in T$, where $T$ is a $k$-flat, and $T \cap \mathbb{Z}^k$ is nonempty, then $F$ is latticial.
\end{defn}

For the purposes of simplifying expressions, we will use the following notation:

\begin{defn}
The {\underline{\bf{$q$-analog of $n$}}}, denoted as $n_q$ is the polynomial 
\begin{center}  $n_q = 1 + q + q^2 + \dots + q^{n-1}$,  \end{center}
where $n \in \mathbb{Z}_{>0}$.
\end{defn}

\section{Morales - Denham Formula}

%\hl{******Short conversation about arbitrary number of generators.  Make sure to write Morales-Denham formula.  Note for up to $3$ generators $P_M (t)$ is a "short" polynomial.*******}

Consider a monoid $M$ with arbitrary many generators, i.e. $M = <a_1, a_2, \ldots, a_d>$, then the Hilbert series can be written as:

\begin{center}  $H_M (z) = \frac{P_M (z)}{(1-z^{a_1})(1-z^{a_2}) \dots (1-z^{a_d})}$, \end{center}
where $P_M (z)$ is a polynomial.  However, when $d \ge 4$, there is no bound on the number of terms for $P_M (z)$.  On the other hand, for $d \le 3$, the formula for $P_M (z)$ and in each case the polynomial is ``short''.  For the purposes of this paper, we will be focusing on the cases where $d=3$. So consider the monoid $M$ with generators $a,b$ and $c$, i.e. $M = <a,b,c>$.  Then the Hilbert Series can be written as:

\begin{center}  $H_M (z) = \frac{P_M (z)}{(1-z^{a})(1-z^{b})(1-z^{c})}$ \end{center}
where $P_M (z)$ depends on the relationship between $R_a a, R_b b$ and $R_c c$ listed above:

\begin{itemize}
\item  When $R_a a, R_b b$ and $R_c c$ are all distinct, then \\
\begin{tabular}{r c l}
$P_M (z)$ & $=$ & $(1 - z^{R_a a})(1 - z^{R_c c}) - z^{R_b b} (1 - z^{s_{ca} a})(1 - z^{s_{ac} c})$ \\
& $=$ & $1 - z^{R_a a} - z^{R_b b} - z^{R_c c} + z^{R_b b + s_{ac} c} + z^{R_b b + s_{ca} b}$
\end{tabular}
\item  When $R_a a = R_b b \not= R_c c$, then $P_M (z) = (1-z^{R_a a})(1-z^{R_c c}) = 1 - z^{R_a a} - z^{R_c c} + z^{R_a a + R_c c}$
\item  When $R_a a = R_b b = R_c c$, then $P_M (z) = (1-z^{R_a a})^2 = 1-2z^{R_a a} + z^{2R_a a}$.
\end{itemize}

\begin{defn}
{\underline{\bf{Simplicial complex $\Phi$}}} on a (finite) set $X$ is a {\underline{\bf{hereditary}}} collection of subsets of $X$, i.e. $A \in \Phi$ and $B \subseteq A$, then $B \in \Phi$.  From the standpoint of a numerical monoid $M = <a_1, a_2, \ldots, a_d>$ where $a_i \in \mathbb{Z}_{> 0}$ and $\gcd (a_1, \ldots, a_d ) = 1$, for any $n \in \mathbb{N}$,
\begin{center}  $\Phi_n := \left \{ \sigma \in \{a_1, \ldots, a_d \} \mid \left (n - \sum_{a_i \in \sigma} \right ) \in M \right \}$. \end{center}
\end{defn}

\begin{rem}
The {\underline{\bf{Reduced Euler Characteristic}}} of a simplicial complex is 
\begin{center}  $\bar{X} = \sum_{\sigma \in \Phi} (-1)^{|\sigma|}$  \end{center}
\end{rem}
where $\dim \sigma = |\sigma | - 1$.

\subsection{$R_a a = R_b b$}

In this case, note that we have that $H_M (z) = \frac{(1-z^{R_a a})(1-z^{R_c c})}{(1-z^{a})(1-z^{b})(1-z^{c})}$.  Thus since $(1-z^{R_a a}) = (1-z^a)(1 + z^a + \dots + z^{(R_a - 1)a})$, then we have 

\begin{center}  $H_M (z) = \frac{(1-z^{R_a a})(1-z^{R_c c})}{(1-z^{a})(1-z^{b})(1-z^{c})} = \frac{(1 + z^a + \dots + z^{(R_a - 1)a})(1 + z^c + \dots + z^{(R_c - 1)c})}{1-z^b}$.  \end{center}

Note that

\begin{tabular}{r c l}
$| \mathbb{N} \backslash M |$ & $=$ & $\lim_{z \rightarrow 1} \left(\frac{1}{1-z} - H_M (z) \right)$ \\
& $=$ & $\lim_{z \rightarrow 1} \left( \frac{1}{1-z} - \frac{(1 + z^a + \dots + z^{(R_a - 1)a})(1 + z^c + \dots + z^{(R_c - 1)c})}{1-z^b} \right)$ \\
& $=$ & $\lim_{z \rightarrow 1} \Bigg[ \frac{(1 + z + \dots + z^{b-1})}{1-z^b}$ \\
& & $\frac{- (1 + z^a + \dots + z^{(R_a - 1)a})(1 + z^c + \dots + z^{(R_c - 1)c})}{1-z^b} \Bigg]$
\end{tabular}

\noindent{But this limit has to exists as it is counting the number of gaps for the monoid $M$, hence $b - R_a R_c = 0$ or $b = R_a R_c$.  Since $a$ and $b$ are symmetrical, we also have that $a = R_b R_c$.  Further,}

\begin{center}
\begin{tabular}{r c l}
$R_c c$ & $=$ & $s_{ca} a + s_{cb} b$ \\
$R_c c$ & $=$ & $R_b R_c s_{ca} + R_a R_c s_{cb}$ \\
$c$ & $=$ & $R_b s_{ca} + R_a s_{cb}$,
\end{tabular}
\end{center}
since $R_c$ does not equal $0$.

\noindent{When $R_a a = R_b b = R_c c$ the converse of this result is true as well:}

\begin{prop}

$R_a a = R_b b = R_c c \iff a = R_b R_c$, $b = R_a R_c$ and $c = R_a R_b$ for some (arbitrary) pairwise coprime positive integers $R_a, R_b$ and $R_c$.  %\hl{Provide Proof if necessary}

\end{prop}

\subsection{$R_a a, R_b b$ and $R_c c$ are distinct}

\begin{lem}
\label{Distinct - Entries}
If $R_a a, R_b b$ and $R_c c$ are distinct, then all $s_{ij} > 0$, where $i,j \in \{ a,b,c \}$ and $i \not= j$.
\end{lem}

\begin{proof}
Assume to the contrary that $s_{ab} = 0$.  Then 
\begin{center}
\begin{tabular} {r l}
& $0 < R_a a = s_{ab} b + s_{ac} c = s_{ac} c$ \\
$\implies$ & $s_{ac} \ge R_c$.
\end{tabular}
\end{center}
If $R_c = s_{ac}$ then we have $R_a a = R_c c$, which is a contradiction.  Thus $s_{ac} > R_c$.
So we have 
\begin{center}
\begin{tabular} {c}
$R_a a = s_{ac} c = R_c c + (s_{ac} - R_c) c$ \\
$R_a a = s_{ca} a + s_{cb} b + (s_{ac} - R_c) c$.  Then \\
$0 < (R_a - s_{ca} ) a = s_{cb} b + (s_{ac} - R_c) c$ 
\end{tabular}
\end{center}
So $s_{ca} = 0$ or we would have a contradiction of the definition $R_a$.  Now 

\begin{center}  $R_c c  =s_{ca} a + s_{cb} b = s_{cb} b$.  \end{center}
So we can say $s_{cb} > R_b$.  So
\begin{center}
\begin{tabular} {r c l}
$R_c c$ & $=$ & $R_b b + (s_{cb} - R_b) b$ \\
& $=$ & $s_{ba} a + s_{bc} c + (s_{cb} - R_b) b$.  Then \\
$0 < (R_c - s_{bc} ) c$ & $=$ & $s_{ba} a + (s_{cb} - R_b) b$ 
\end{tabular}
\end{center}
So. again, $s_{bc} = 0$, otherwise we have a contradiction.  Now 

\begin{center}  $R_b b  =s_{bc} c + s_{ba} a = s_{ba} a$.  \end{center}
So, now we can say $s_{ba} > R_a$.  Hence we have 
\begin{center}  $R_a a = s_{ac} c > R_c c = s_{cb} b > R_b b = s_{ba} a > R_a a$, \end{center}
which can not be true, hence we have a contradiction.  Therefore, $s_{ab} \not= 0$.
\end{proof}

\begin{lem}
$R_a > s_{ba}$
\end{lem}

\begin{proof}
Assume to the contrary that $s_{ba} \ge R_a$. Then we have
\begin{center}
\begin{tabular} {r c l}
$R_b b$ & $=$ & $s_{ba} a + s_{bc} c$ \\
& $=$ & $R_a a + (s_{ba} - R_a ) a + s_{bc} c$ \\
& $=$ & $s_{ab} b + s_{ac} c + (s_{ba} - R_a) a + s_{bc} c$
\end{tabular}
\end{center}
Then, since $s_{ab} > 0$ by the previous Lemma, we have 
\begin{center}  $R_b b > (R_b - s_{ab}) b = (s_{ac} + s_{bc}) c + (s_{ba} - R_a) a$.  \end{center}
However, note that by the previous Lemma and our assumption, we have a positive multiple of $b$ written in terms of $a$ and $c$ that is strictly smaller than $R_b b$, which is a contradiction of the definition of $R_b$.  Therefore, $R_a > s_{ba}$.  (By symmetry, we have similar inequalities involving $R_b$ and $R_c$.
\end{proof}

\begin{note}
$\Phi_{R_a a + s_{bc} c} = 2^{\{ a,b,c \} } - \{a,b,c \} $.
\end{note}

\begin{proof}
Let $n = R_a a + s_{bc} c$.  See that 
\begin{itemize}
\item  $R_a, s_{bc} > 0 \implies n - a - c = (R_a - 1) a + (s_{bc} - 1)c \implies \{a,c \} \in \Phi_n$;
\item  $R_a a + s_{bc} c = s_{ab} b + s_{ac} c + s_{bc} c \implies \{b,c \} \in \Phi_n$, since $s_{ab}, s_{ac}$ and $s_{bc} >0$;
\item  $R_a a + s_{bc} c > s_{ba} a + (R_a - s_{ba})a + s_{bc} c = (R_a - s_{ba})a + R_b b \implies \{a, b \} \in \Phi_n$.
\end{itemize}
Therefore, all proper subsets of $\{ a,b,c \}$ are contained in $\Phi_n$.  But is $\{ a,b,c \} \in \Phi_n$, i.e there exists $k,l,m \in \mathbb{Z}_{>0}$ such that $n = ka + lb + mc$?  Assume this is the case.  Then
\begin{enumerate}
\item  $s_{bc} > m$, otherwise, $s_{bc} \le m$, so
\begin{center}  
\begin{tabular} {r c l}
$n = R_a a + s_{bc} c$ & $=$ & $ka + lb +mc$ \\
$R_a a$ & $=$ & $ka + lb + (m-s_{bc}) c$, then \\
$R_a a > (R_a - k) a$ & $=$ & $lb + (m - s_{bc})c >0$, 
\end{tabular}
\end{center}
which contradicts the definition of $R_a$.
\item  $R_a - s_{ba} > k$, otherwise $R_a - s_{ba} \le k$, so
\begin{center}
\begin{tabular} {r c l}
$n = R_a a + s_{bc} c$ & $=$ & $ka + lb + mc$ \\
$R_ a a + (R_b b - s_{ba} a)$ & $=$ & $ka + lb + mc$ \\
$R_b b + (R_a - s_{ba}) a$ & $=$ & $ka + lb + mc$, then \\
$R_b b > (R_b - l) b$ & $=$ & $(k - (R_a - s_{ba}) ) a + mc > 0$ 
\end{tabular}
\end{center}
which contradicts the definition of $R_b$.
\end{enumerate}  

Now $R_a a + s_{bc} c = ka + lb + mc$ then
\begin{center}  $0 < (R_a - k)a + (s_{bc} - m) c = lb \implies l \ge R_b$. \end{center}

Now note that since 
\begin{center}
\begin{tabular} {r l}
& $n = R_b b = (R_a - s_{ba})a = kl + lb + mc$ \\
$\implies$ & $R_a a > (R_a - s_{ba} - k)a = (l - R_b)b + mc$.
\end{tabular}
\end{center}
So we have a contradiction to the definition of $R_a$.  Hence $\{ a,b,c \} \in \Phi_n$.
\end{proof}

Let $M = <a,b,c>$ where $R_a a, R_b b$ and $R_c c$ are distinct.  If $\Phi _n = 2^{\{ a_1, \ldots, a_d \} } - \{a,b,c \} $, then
\begin{center}  
\begin{tabular} {r c l}
$n \in \{R_a a + s_{bc} c , R_c c + s_{ba} a \}$ & $=$ & $\{ R_b b + s_{ac} c, R_c c +s_{ab} b \}$ \\
& $=$ & $\{ R_a a + s_{cb} b, R_b b + s_{ca} a \}$
\end{tabular}
 \end{center}
Suppose $R_c c + s_{ba} a = R_c c + s_{ab} b$.  This implies that $s_{ba} \ge R_a$ which is a contradiction.  So 
\begin{center}
\begin{tabular} {r c l}
$R_c c + s_{ba} a$ & $=$ & $R_b b + s_{ac} c$ \\
$s_{ca} a + s_{cb} b + s_{ba} a$ & $=$ & $s_{ba} a + s_{bc} c + s_{ac} c$ \\
$s_{ca} a + s_{cb} b$ & $=$ & $s_{bc} c + s_{ac} c$ \\
$R_c c$ & $=$ & $s_{bc} c + s_{ac} c$ \\
$R_c$ & $=$ & $s_{bc} + s_{ac}$.
\end{tabular}
\end{center}

Since, in this case, $a, b$ and $c$ are symmetric, we also have that

\begin{itemize}
\item  $R_b = s_{ab} + s_{cb}$;
\item  $R_a = s_{ba} + s_{ca}$.
\end{itemize}

%Note that if $R_a a, R_b b$ and $R_c c$ are distinct then
%\begin{itemize}
%\item  $R_a = s_{ba} + s_{ca}$
%\item  $R_b = s_{ab} + s_{cb}$
%\item  $R_c = s_{ac} + s_{bc}$
%\end{itemize}

In this case, following the same technique as the previous section, 

\begin{center}
\begin{tabular}{r c l}
$H_M (z)$ & $=$ & $\frac{(1 - z^{R_a a})(1 - z^{R_c c}) - z^{R_b b} (1 - z^{s_{ca} a})(1 - z^{s_{ac} c})}{(1-z^{a})(1-z^{b})(1-z^{c})}$ \\
& $=$ & $\frac{(1 + z^a + \dots z^{(R_a -1)a})(1 + z^c + \dots + z^{(R_c -1)c})}{1-z^{b}}$ \\
& & $- \frac{z^{R_b b} (1 + z^a+ \dots + z^{(s_{ca} -1)a})(1 + z^c + \dots + z^{(s_{ac} -1)c})}{1-z^{b}}$
\end{tabular}
\end{center}

Thus we have that 

\begin{tabular}{r c l}
$| \mathbb{N} \backslash M |$ & $=$ & $\lim_{z \rightarrow 1} \left(\frac{1}{1-z} - H_M (z) \right)$ \\
& $=$ & $\lim_{z \rightarrow 1} \Bigg[ \frac{1}{1-z} - \frac{(1 + z^a + \dots z^{(R_a -1)a})(1 + z^c + \dots + z^{(R_c -1)c})}{1-z^{b}}$  \\
& & $- \frac{z^{R_b b} (1 + z^a+ \dots + z^{(s_{ca} -1)a})(1 + z^c + \dots + z^{(s_{ac} -1)c})}{1-z^{b}} \Bigg]$ \\
& $=$ & $\lim_{z \rightarrow 1} \Bigg[ \frac{1+z + \dots + z^{b-1}}{1-z^{b}}$ \\
& & $ - \frac{(1 + z^a + \dots z^{(R_a -1)a})(1 + z^c + \dots + z^{(R_c -1)c})}{1-z^{b}}$ \\
& & $+ \frac{z^{R_b b} (1 + z^a+ \dots + z^{(s_{ca} -1)a})(1 + z^c + \dots + z^{(s_{ac} -1)c})}{1-z^{b}} \Bigg]$ \\
\end{tabular} \\


Once again, this counts the genus of the monoid, thus the limit exists, hence the numerator has to equal $0$, i.e. $b - R_a R_c +s_{ca} s_{ac} = 0$ or $b = R_a R_c - s_{ca} s_{ac}$.  Since $a,b$ and $c$ are all symmetric, we also have

\begin{center}
\begin{itemize}
\item  $a = R_b R_c - s_{cb} s_{bc}$
\item  $c = R_a R_b - s_{ab} s_{ba}$
\end{itemize}
\end{center}

\section{The Johnson Transformation}



Here we will be considering $2$ cases:

\begin{enumerate}
\item  $R_a a = R_b b$; and 
\item  $R_a a, R_b b$ and $R_c c$ are distinct
\end{enumerate}

{\noindent{{\underline{\bf{Case 1: $R_a a = R_b b$}}}}

In this case, after picking the $2$ distinct Johnson relations, our matrix $A$ will look like the following:

\begin{center} $A = \begin{bmatrix}
  s_{ca} & -R_a & t_a \\
  s_{cb} & R_b & t_b \\
  -R_c & 0 & t_c
\end{bmatrix}$.  \end{center}
Consider the determinant of our matrix 

\begin{center}  \begin{tabular} {r c l}
$\det (A)$ & $=$ & $\begin{vmatrix}
  s_{ca} & -R_a & t_a \\
  s_{cb} & R_b & t_b \\
  -R_c & 0 & t_c
\end{vmatrix}$  \\
& $=$ & $t_a \begin{vmatrix}
 s_{cb} & R_b \\
 -R_c & 0
\end{vmatrix} - t_b
\begin{vmatrix}
  s_{ca} & -R_a \\
  -R_c & 0
\end{vmatrix} + t_c
\begin{vmatrix}
  s_{ca} & -R_a \\
  s_{cb} & R_b
\end{vmatrix}$ \\
& $=$ & $t_a (R_b R_c ) + t_b (R_a R_c) + t_c ( s_{ca} R_b + s_{cb} R_a )$ \\
& $=$ & $t_a a + t_b b + t_c c = 1$.
\end{tabular}
 \end{center}
 Therefore, in this case $A \in SL_2 (\mathbb{Z})$.

{\noindent{\underline{\bf{Case 2: $R_a a, R_b b$ and $R_c c$ are distinct}}}}

In this case, after picking the $2$ distinct Johnson relations, our matrix $A$ will look like the following:

\begin{center}  $A = \begin{bmatrix}
  s_{ba} & s_{ca} & t_a \\
  -R_b & s_{cb} & t_b \\
  s_{bc} & -R_c & t_c
\end{bmatrix}$.  \end{center}
Consider the determinant of our matrix 

\begin{center} \begin{tabular} {r c l}
$\det (A)$ & $=$ & $\begin{vmatrix}
  s_{ba} & s_{ca} & t_a \\
  -R_b & s_{cb} & t_b \\
  s_{bc} & -R_c & t_c
\end{vmatrix}$ \\
& $=$ & $t_a \begin{vmatrix}
  -R_b & s_{cb} \\
  s_{bc} & -R_c
\end{vmatrix} - t_b \begin{vmatrix}
  s_{ba} & s_{ca} \\
  s_{bc} & -R_c
  \end{vmatrix} + t_c
  \begin{vmatrix}
  s_{ba} & s_{ca} \\
  -R_b & s_{cb}
\end{vmatrix}$ \\
& $=$ & $t_a ( R_b R_c - s_{cb} s_{bc} ) + t_b ( s_{ba} R_c + s_{bc} s_{ca} ) + t_c ( s_{ba} s_{cb} + R_b s_{ca} )$ \\
& $=$ & $t_a a + t_b ( s_{ba} R_c + s_{bc} s_{ca} ) + t_c ( s_{ba} s_{cb} + R_b s_{ca} )$.
\end{tabular}
\end{center}
But note that in this case

\begin{center} \begin{tabular} {r c l}
$s_{ba} R_c + s_{bc} s_{ca}$ & $=$ & $(R_a - s_{ca} ) R_c + s_{ca} s_{bc}$ \\
& $=$ & $R_a R_c - s_{ca} R_c + s_{ca} s_{bc}$ \\
& $=$ & $R_a R_c - s_{ca} (s_{ac} + s_{bc} ) + s_{ca} s_{bc}$ \\
& $=$ & $R_a R_c - s_{ca} s_{ac} - s_{ca} s_{bc} + s_{ca} s_{bc}$ \\
& $=$ & $R_a R_c - s_{ca} s_{ac} = b$,
\end{tabular}
\end{center}

$\because R_a = s_{ba} + s_{ca}$ or $s_{ba} = R_a - s_{ca}$ and $R_c = s_{ac} + s_{bc}$ in this case, as previously shown.  Similarly, $s_{ba} s_{cb} + R_b s_{ca} = c$.  Therefore, $\det (A) = t_a a + t_b b + t_c c = 1$.  So once again, in this case, $A \in SL_2 (\mathbb{Z})$.

\newpage

\chapter{Discrete Fourier Transform} %\hl{Look this up} (or Fourier Dedekind Sums)

\section{Basic Information and Properties}

Let $b \in \mathbb{Z}_{>0}$.  Then define 

\begin{center}  $V_b := \{ f : \mathbb{N}$ (or  $\mathbb{Z}) \longrightarrow \mathbb{C} | f(n+b) = f(n), \forall n \in \mathbb{N} \}$, \end{center}
i.e. the set of all $b$-periodic functions form $\mathbb{N}$ (or $\mathbb{Z})$ into $\mathbb{C}$.  This is a vector space over $\mathbb{C}$ because $f+g$ and $\lambda f$ is in this set $\forall \lambda \in \mathbb{C}$ and $f,g \in V_b$.  For convenience, we can also write a $b$-periodic function as $f(n) = f (n \text{ MOD } b)$ where $n \text{ MOD } b := b \left \{ \frac{n}{b} \right \}$.  Now let's define $\omega_b$ where $\omega_{b} = e^{\frac{i 2 \pi}{b}}$, a primitive $b^{th}$ root of uinity.  Then note that 

\begin{center}  $\omega_{b}^{n+b} = \omega_{b}^{n} \omega_{b}^{b} = \omega_{b}^{n}$ and $\omega_{b}^{k(n+b)} = \omega_{b}^{kn} \omega_{b}^{kb} = \omega_{b}^{kn}$, \end{center}
and hence $f(n) := \omega_b^{n} \in V_b$.  Futhermore,  $\{ 1, \omega_{b}^{n} , \omega_{b}^{2n} , \ldots , \omega_{b}^{(b-1)n} \} = \{ \omega_{b}^{k} \}_{k=0}^{b-1}$ is a basis for $V_b$, which is called the Fourier Basis.  Note that this basis is also orthonormal with respect to the Hermitian Inner Product and hence it is linearly independent.  

Now consider $f,g,h \in V_b$ and let define the {\underline{\bf{Hermitian Inner Product}}} $<f,g> := \frac{1}{b} \sum_{n=0}^{b-1} f(n) \bar{g(n)}$, where $\bar{g(n)}$ is the complex conjugate of $g(n)$.

%Use of {\underline {Hermitian Inner Product}} \\
%$<f,g> = \frac{1}{B} \sum_{n=0}^{B-1} f(n) \bar{g(n)}$

%Define $\omega = \omega_B = e^{\frac{i 2 \pi}{B}}$.  Then $n \longmapsto \omega^{kn} \in V_B$.

%$\{ 1, \omega^n , \omega^{2n} , \ldots , \omega^{(B-1)n} \}$ is an orthonormal basis of $V_B$.

%$f \stackrel{\text{discrete Fourier Transform (DFT)}}{\longrightarrow} \hat{f} \longleftarrow$ we may think of $\hat{f} \in \mathbb{C}^B \longleftrightarrow V_B$

%$f(n)$ has average $=0$ iff $\hat{f} (0) = 0$ iff $f(n) = \sum_{k=1}^{B-1} \hat{f} (k) \omega^{kn}$.

Now, lets list some properties of the Hermitian Inner Product:

\begin{enumerate}
\item  $<g,f> = \frac{1}{b} \sum_{n=0}^{b-1} g(n) \bar{f(n)} = \bar{<f,g>}$
\item  $<f+g,h> = <f,h>+<g,h>$ and $<\lambda f,g> = \lambda <f,g>$
\item  $<f,\lambda h> = \bar{\lambda} <f,h>$
\item  $<f,f> = \frac{1}{b} \sum |f(n)|^2 \ge 0$ and $=0$ iff $f \equiv 0$.
\end{enumerate}
%Fact:  $\{ 1, \omega^n , \omega^{2n}, \ldots , \omega^{(b-1)n} \}$ is an orthonormal basis for $V_b$.  Hence this basis is linearly independent.
For all $f \in V_b$, $f(n) = c_0 1 + c_1 \omega^n + c_2 \omega^{2n} + \dots + c_{b-1} \omega^{(b-1)n}$ where $\omega = \omega_b = e^{\frac{i 2 \pi}{b}}$.

\begin{center}
\begin{tabular}{r c l}
$<f,\omega^{kn}>$ & $=$ & $c_0 <1, \omega^{kn}> + c_1 <\omega^n, \omega^{kn}>+ \dots + c_{b-1}<\omega^{(b-1)n}, \omega^{kn}>$ \\
& $=$ & $c_k <\omega^{kn},\omega^{kn}> = c_k$ are called $\hat{f} (k)$ where $k = 0,1,\ldots, b-1$
\end{tabular}
\end{center}
So $f(n) = \sum_{k=0}^{b-1} \hat{f}(k) \omega^{kn}$.  Further, $f \longrightarrow \hat{f}$ is called the Discrete Fourier Transform (DFT).  Therefore, for any $f \in V_b , f(n) = \sum_{k=0}^{b-1} \hat{f} (k) \omega_b^{kn}$ and $\hat{f} (k) = <f, \omega_b^{kn} > = \frac{1}{b} \sum_{n=0}^{b-1} f(n) \bar{\omega_b}^{kn}$.  Finally note that $\hat{f} (0) =\frac{1}{b} \sum_{n=0}^{b-1} f(n) =$ average over $1$ period of $f$ or average$(f)$.  A basis for $b$-periodic ($\mathbb{C}$-valued) functions with average $0$ is $\{ \omega_{b}^{k} \}_{k=1}^{b-1}$.  %(which is in Chapter 7 of CCD).

%So related to previous work,
%\begin{center}  $\gcd (a,b) = 1$ and $s \equiv a^{-1} \mod b$ \end{center}

%What is the Discrete Fourier Transform of $f(sn)$ in terms of $\hat{f}$?



%\begin{center}  $(\omega_{b}^{k})^0 + (\omega_{b}^{k})^1 + \dots + (\omega_{b}^{k})^{b-1}$, where $0 < k < b$ \end{center}
%\begin{center}  $= 1 + \omega^k + \omega^{2k} + \dots + \omega^{(b-1)k}$ \end{center}

\begin{note}
Consider the following:  $1-z^b = (1-z)(1+z+\dots+z^{b-1})$, hence $0 = 1-(\omega_b^k)^b = (1-\omega_b^k)(1 + \omega_b + \omega_b^{2} + \dots + \omega_b^{b-1})$ and since $1-\omega_b^k \neq 0$, then $1 + \omega_b + \omega_b^{2} + \dots + \omega_b^{b-1} = 0 \implies \frac{1-\omega_b^{kb}}{1-\omega_b^k} = 1 + \omega_b + \omega_b^{2} + \dots + \omega_b^{b-1}$.
\end{note}

%{\bf{Example:}}

%$f(n) = \left \{ \frac{n}{b} \right \}$ \\

%$\left \{ \frac{n}{b} \right \} = \sum_{k=1}^{b-1} \frac{\omega^{kn}}{1-\bar{\omega}^k}$ and $\hat{f} = \frac{1}{1-\bar{\omega}^k}$.\\

%$\left \{ \frac{sn}{b} \right \} =$ ?

%$B$ is a positive integer.  Then we can define the following:

%\begin{center}
%\begin{tabular}{r c l}
%$V_B$ & $=$ & $ \{ f : \mathbb{N} \longrightarrow \mathbb{C} | f(n+B) = f(n) \} \cong \mathbb{C}^B$ (complex vector space with $B$ coordinates) \\
%& & (changing $\mathbb{N}$ to $\mathbb{Z}$ changes nothing for $V_B$) \\
%& & $f \longmapsto \begin{bmatrix}
 %   f(0)     \\
  %  f(1)     \\
  %  f(2)     \\ 
   % \vdots \\
   % f(B-1)     
%\end{bmatrix} $
%\end{tabular}
%\end{center}

%{\bf {Example:}} \\

%$f(n) = \left \{ \frac{n}{B} \right \} \in V_B$, $\hat{f} (0) = \frac{B(B-1)}{2b^2} = \frac{B-1}{2B}$

%$sa \equiv 1 \mod B$ or $s \equiv a^{-1} \mod B$

%$f \in V_B$; $g(n) := f(sn)$

%Consider $\left \{ \frac{n}{B} \right \} \in V_B$, where $\left \{ \frac{n}{B} \right \} = \sum_{k=0}^{B-1} \hat{f} (k) \omega^{kn}$.  What about $\left \{ \frac{sn}{B} \right \}$ ?

%When we change the input from $n$ to $sn$, what happens to $\hat{f}$?

\noindent{Now lets look at three operations on $V_b$ that will be used:}
\begin{enumerate}
\item The first property we will discuss is called {\underline{\bf{translation}}}, which will be denoted as $T_a$, where $a \in \mathbb{Z}$.  This is a linear property such that  
\begin{center}
\begin{tabular}{r c l}
$T_a$ & $:$ & $V \longrightarrow V$  \\
& & $f (n) \mapsto f(n-a)$ or \\
& & $(T_a f) (n) = f(n-a)$
\end{tabular}
\end{center}

Note that this property is invertible as $T_a \circ T_{-a} = id_V = T_{-a} \circ T_a$.  The next question that we need to ask is $\hat{T_a f} (k) =$?

\begin{center}
\begin{tabular}{r c l}
$\hat{T_a f} (k)$ & $=$ & $<T_a f, \omega^{kn}>$ \\
& $=$ & $\frac{1}{b} \sum_{n=0}^{b-1} f(n-a) \bar{\omega}^{kn}$ \\
& $=$ & $\frac{1}{b} \sum_{m=0}^{b-1} f(m) \bar{\omega}^{k(m+a)}$, where we let $m = n-a$ \\
& &(sum starts at $m=0$ since $f$ is $b$-periodic) \\
& $=$ & $<f(m) \bar{\omega}^{ka}, \omega^{km}>$ \\
& $=$ & $\bar{\omega}^{ka} <f(m), \omega^{km}>$ \\
& $=$ & $\bar{\omega}^{ka} \hat{f} (k)$
\end{tabular}
\end{center}
Thus we have that $\hat{T_a f} (k) = \bar{\omega}^{ka} \hat{f} (k)$.

\item The next property we will discuss is called {\bf{\underline{dilation}}}, which will be denoted as $U_s$, where $s \in \mathbb{Z}$ and $\gcd (b,s) = 1$, i.e. $\exists a, t \in \mathbb{Z}$ such that $sa+tb = 1$ and hence $a \equiv s^{-1} \mod b$, i.e. $sa \equiv 1 \mod b$, such that:
\begin{center}
\begin{tabular}{r c l}
$U_s$ & $:$ & $V \longrightarrow V$ \\
& & $f(n) \mapsto f(sn)$  \\
& & $U_s f(n) := f(sn)$ 
\end{tabular}
\end{center}

%{\underline{Example}}

%$b=3$; $s=2 \equiv -1 \mod 3$ \\
%\begin{tabular}{r c l}
%{\underline{n}} & & {\underline{sn}} \\
%$0$ & $\mapsto$ & $0$ \\
%$1$ & $\mapsto$ & $2$ (which is $\equiv -1 \mod 3$) \\
%$-1$ which is $\equiv 2 \mod 3$) & $\mapsto$ & $1$
%\end{tabular}

So, since $sa \equiv 1 \mod B$, then $U_a = U_s^{-1}$.  Once again, we now need to ask $(\hat{U_s f}) (k) =$?

\begin{center}  $(\hat{U_s f}) (k) = <U_s f, \omega^{kn}> = \frac{1}{b} \sum f(sn) \bar{\omega}^{kn} = \frac{1}{b} \sum f(m) \bar{\omega}^{kam} = \hat{f} (ak)$,  \end{center}
where $m = sn$ and hence $am = n$.  Thus we have that  $(\hat{U_s f}) (k) = \hat{f} (ak) = (U_a \hat{f}) (k)$.

%\begin{theorem}
%$\hat{U_s f} = U_a \hat{f}$ where $sa \equiv 1 \mod B$.
%\end{theorem}

\item  The final property we will use is called {\bf{\underline{modulation}}}.  This will be denoted as $M_d$, where $d \in \mathbb{Z}$ such that:
\begin{center}
\begin{tabular}{r c l}
$M_d$ & $:$ & $V \longrightarrow V$ \\
& & $f(n) \mapsto \omega^{nd} f(n)$  \\
& & $M_d f(n) := \omega^{nd} f(n)$. 
\end{tabular}
\end{center}

What is $\hat{M_d}$?

\begin{center}  $(\hat{M_d f}) (k) = <M_d f, \omega^{kn}> = \frac{1}{b} \sum \omega^{nd} f(n) \bar{\omega}^{kn} = \frac{1}{b} \sum f(n) \bar{\omega}^{n(k-d)} = \hat{f} (k-d)$,  \end{center}

thus we have that $(\hat{M_d f}) (k) =  \hat{f} (k-d)$.

%{\underline{Example}} \\
%$\frac{b-1}{2b} - \left \{ \frac{n}{b} \right \} = \frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega^{kn}}{(1-\bar{\omega}^{k})}$.  Note $\frac{b-1}{2b}$ is the average of $\left \{ \frac{n}{b} \right \}$.

%Also note $\hat{f} (0) = \frac{1}{b} \sum_{n=0}^{b-1} f(n) =$ average of $f$ over a period.

%If we let $f = \frac{b-1}{2b} - \left \{ \frac{n}{b} \right \}$, then $\hat{f} (k) = \frac{1}{b(1-\bar{\omega}^{k})}$ for $k = 1,2, \ldots , b-1$.
\end{enumerate}

%Define
%\begin{center}
%\begin{tabular}{r c l}
%$V_B$ & $\stackrel{U_s}{\longrightarrow}$ & $V_B \stackrel{U_a}{\longrightarrow} V_B$, \\
%& & where $U_s$ is called dialation by $s$ and $U_a$ is dialation by $a$. \\
%$f(n)$ & $\longmapsto$ & $f(sn)$ \\
%& & $g(n) \longmapsto g(an)$
%\end{tabular}
%\end{center}

%$(U_s f) (n) = f(sn)$

%What is $\hat{U_s f}$ ?

%$f(n) = \sum_{k=0}^{B-1} \hat{f} (k) \omega^{kn}$, so $f(sn) = \sum_{k=0}^{B-1} \hat{f} (k) (\omega^{ks})^n$.

%Let $l \equiv ks \mod B$, then we have $k \equiv al \mod B$, so
%\begin{center}  $U_s f (n) = f(sn) = \sum_{l=0}^{B-1} \hat{f} (al) \omega^{ln}$ \end{center}

%$\therefore \hat{U_s f} (l) = \hat{f} (al) = U_a \hat{f} (l)$.



%Let $V_B \stackrel{T_d}{\longrightarrow} V_B$ where $f(n) \longmapsto f(n + d)$. Then we have $(T_d f)(n) := f(n+d)$.

%What is $\hat{T_d f}$?

%$(T_d f)(n) = f(n+d) = \sum_{k=0}^{B-1} \hat{f} (k) \omega^{k(n+d)} = \sum_{k=0}^{B-1} \hat{f} (k) \omega^{kd} \omega^{kn}$

%$\therefore \hat{T_d f} (k) = \hat{f} (k) \omega^{kd}$ i.e. $\hat{T_d f} = M_d \hat{f}$ where $V_B \stackrel{M_d}{\longrightarrow} V_B$ such that $f(n) \longmapsto \omega^{nd} f(n)$.  $M$ is referred to as modulation. \\

%So consider $f(n) = \sum_{k=1}^{B-1} \frac{\omega^{kn}}{1 - \bar{\omega}^k} \Longleftrightarrow \hat{f} (k) = \left\{
%  \begin{array}{@{}ll@{}}
%    \frac{1}{1- \bar{\omega}^k}, & k \neq 0 \\
%    0, & k=0
%  \end{array}\right. $ \\

%The following are are couple straightforward examples:

%\begin{itemize}
%\item $\left \{ \frac{n}{B} \right \} = f(n)$ \\
%$f(sn) = \sum_{l=1}^{B-1} \frac{\omega^{ln}}{1-\bar{\omega}^{al}}$ where $sa \equiv 1 \mod B$.
%\item $f(sn+d) = \left \{ \frac{sn+d}{B} \right \}$ $\longleftarrow$ (or $(U_s T_d f)(n)$) \\
%$\hat{T_d U_s f} = M_d \hat{U_s f}$

%\begin{center}
%\begin{tabular}{ c | c | c } 
%$\hat{f} (k)$ & $\hat{U_s f} (k)$ & $\hat{T_d U_s f (k)}$ \\ 
%\hline
%$\frac{1}{1-\bar{\omega}^k}$ & $\frac{1}{1-\bar{\omega}^{ak}}$ & $\frac{\omega^{dk}}{1-\bar{\omega}^{ak}}$ \\ 
%\end{tabular}
%\end{center}
%\end{itemize}


%{\bf \underline{DFT}}
%\begin{center}
%\begin{tabular} {r c l}
%$V = V_b$ & $=$ & $\{ f: \mathbb{N} \longrightarrow \mathbb{C} | f(n+b) = f(n) \}$ where $b$ is a positive integer. \\
%& $\cong$ & $\mathbb{C}^b \cong \{ f: \mathbb{Z} \longrightarrow \mathbb{C} | f(n+ b) = f(n) \} $ \\
%& & $f \longmapsto \begin{bmatrix}
%    f(0)     \\
%    f(1)     \\
%    f(2)     \\ 
%    \vdots \\
%    f(b-1)     
%\end{bmatrix} 
%\longleftarrow f $ (could not find the "mapsto" with the arrow pointing left)
%\end{tabular}
%\end{center}

%$<f,g> := \frac{1}{b} \sum_{n=0}^{b-1} f(n) \bar{g(n)}$

%$\{ 1, \omega^n , \omega^{2n} , \omega^{3n}, \ldots , \omega^{(b-1)n} \} = \{ \omega^{kn}\} _{k=0}^{b-1} = \{ \alpha ^{kn} | \alpha ^b = 1 \}$, where $\omega = \omega_b := e^{\frac{i 2\pi}{b}}$ (a primitive $b^{th}$ root of unity)

%Then $f(n) = \sum_{k=0}^{b-1} \hat{f} (k) \omega^{kn}$, where $f \in V$.

%Since this basis is orthonormal, $\hat{f} (k) = <f, \omega^{kn} > = \frac{1}{b} \sum_{k=0}^{b-1} f(n) \bar{\omega}^{kn}$.

%There are $3$ operations on $V$ we will discuss:

%\begin{enumerate}
%\item {\underline{Translation}} 
%\begin{center}
%\begin{tabular}{r c l}
%$T_a$ & $:$ & $V \stackrel{linear}{\longrightarrow} V$ where $a \in \mathbb{Z}$ \\
%& & $f (n) \mapsto f(n-a)$ or \\
%& & $(T_a f) (n) = f(n-a)$
%\end{tabular}
%\end{center}

%Note: $T_a \circ T_{-a} = id_V = T_{-a} \circ T_a$, i.e. this is invertible.

%$\hat{T_a f} (k) =$ ?

%\begin{center}
%\begin{tabular}{r c l}
%$\hat{T_a f} (k)$ & $=$ & $<T_a f, \omega^{kn}>$ \\
%& $=$ & $\frac{1}{b} \sum_{n=0}^{b-1} f(n-a) \bar{\omega}^{kn}$ \\
%& $=$ & $\frac{1}{b} \sum_{m=0}^{b-1} f(m) \bar{\omega}^{k(m+a)}$, where we let $m = n-a$ \\
%& &(sum starts at $m=0$ since $f$ is $b$-periodic) \\
%& $=$ & $<f(m) \bar{\omega}^{ka}, \omega^{km}>$ \\
%& $=$ & $\bar{\omega}^{ka} <f(m), \omega^{km}>$ \\
%& $=$ & $\bar{\omega}^{ka} \hat{f} (k)$
%\end{tabular}
%\end{center}
%So $\hat{T_a f} (k) = \bar{\omega}^{ka} \hat{f} (k)$

%\item {\underline{Dilation}}
%\begin{center}
%\begin{tabular}{r c l l}
%$U_s$ & $:$ & $V \longrightarrow V$ & where $s \in \mathbb{Z}$ and $\gcd (b,s) = 1$, i.e. $\exists %a, t \in \mathbb{Z}$ such that $sa+tb = 1$ \\
%& & & i.e. $a \equiv s^{-1} \mod b$, i.e. $sa \equiv 1 \mod b$ \\
%& & $f(n) \mapsto f(sn)$ & \\
%& & $U_s f(n) := f(sn)$ &
%\end{tabular}
%\end{center}

%{\underline{Example}}

%$b=3$; $s=2 \equiv -1 \mod 3$ \\
%\begin{tabular}{r c l}
%{\underline{n}} & & {\underline{sn}} \\
%$0$ & $\mapsto$ & $0$ \\
%$1$ & $\mapsto$ & $2$ (which is $\equiv -1 \mod 3$) \\
%$-1$ which is $\equiv 2 \mod 3$) & $\mapsto$ & $1$
%\end{tabular}

%$(\hat{U_s f}) (k) =$ ?

%$(\hat{U_s f}) (k) = <U_s f, \omega^{kn}> = \frac{1}{b} \sum f(sn) \bar{\omega}^{kn} = \frac{1}{b} \sum f(m) \bar{\omega}^{kam} = \hat{f} (ak)$

%So $(\hat{U_s f}) (k) = \hat{f} (ak) = (U_a \hat{f}) (k)$.

%\item  We can also write a $b$-periodic function as $f(n) = f (n \text{ MOD } b)$ where $n \text{ MOD } b := b \left \{ \frac{n}{b} \right \}$

%{\underline{Example}} \\
%$\frac{b-1}{2b} - \left \{ \frac{n}{b} \right \} = \frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega^{kn}}{(1-\bar{\omega}^{k})}$.  Note $\frac{b-1}{2b}$ is the average of $\left \{ \frac{n}{b} \right \}$.

%Also note $\hat{f} (0) = \frac{1}{b} \sum_{n=0}^{b-1} f(n) =$ average of $f$ over a period.

%If we let $f = \frac{b-1}{2b} - \left \{ \frac{n}{b} \right \}$, then $\hat{f} (k) = \frac{1}{b(1-\bar{\omega}^{k})}$ for $k = 1,2, \ldots , b-1$.
%\end{enumerate}

%\colorbox{red}{Let $f_{<a,b,c>} (n) = rn^2 + sn + t$.}

%\begin{itemize}
%\item $n^2$ only appears once, with coefficient $B_3$, so
%\begin{center}  $r = \frac{1}{abc}$ \end{center}
%\item $n$ appears with coefficients $B_2$, $B_3$, $C_2^{\omega}$, $D_2^{\omega}$ and $E_2^{\omega}$, so
%\begin{center}
%\begin{tabular}{r c l}
%$s$ & $=$ & $ \frac{a+b+c-3}{2abc} + \frac{3}{abc} + \sum_{\substack{w^C=1 \\ w \neq 1}} \frac{\omega ^n}{ab(1-\bar{\omega}^c)} + \sum_{\substack{w^B=1 \\ w \neq 1}} \frac{\omega ^n}{ac(1-\bar{\omega}^b)} + \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{bc(1-\bar{\omega}^a)}$ \\
%& $=$ & $ \frac{a+b+c+3}{2abc} + \frac{1}{ab} \sum_{\substack{w^C=1 \\ w \neq 1}} \frac{\omega ^n}{(1-\bar{\omega}^c)} + \frac{1}{ac} \sum_{\substack{w^B=1 \\ w \neq 1}} \frac{\omega ^n}{(1-\bar{\omega}^b)} + \frac{1}{bc} \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{(1-\bar{\omega}^a)}$ \\
%& $=$ & $ \frac{a+b+c+3}{2abc} + \frac{1}{ab} \left ( -C \left \{ \frac{s_3 n}{C} \right \} + \frac{C}{2} - \frac{1}{2} \right ) + \frac{1}{ac} \left ( -B \left \{ \frac{s_2 n}{B} \right \} + \frac{B}{2} - \frac{1}{2} \right )$ \\
%& & $+ \frac{1}{bc} \left ( -A \left \{ \frac{s_1 n}{A} \right \} + \frac{A}{2} - \frac{1}{2} \right )$ where $s_1a + t_1 A = 1; s_2 b + t_2 B = 1; s_3 c + t_3 C = 1$. \\
%& $=$ & $\frac{a+b+c+3}{2abc} - \frac{C}{ab} \left \{ \frac{s_3 n}{C}\right \} - \frac{B}{ac} \left \{ \frac{s_2 n}{B} \right \} - \frac{A}{bc} \left \{ \frac{s_1 n}{A} \right \} + \frac{C}{2ab} + \frac{B}{2ac} + \frac{A}{2bc}$ \\
%& & $- \frac{1}{2ab} - \frac{1}{2ac} - \frac{1}{2bc}$ \\
%& $=$ & $\frac{a+b+c+3}{2abc} - \frac{C}{ab} \left \{ \frac{s_3 n}{C}\right \} - \frac{B}{ac} \left \{ \frac{s_2 n}{B} \right \} - \frac{A}{bc} \left \{ \frac{s_1 n}{A} \right \} + \frac{cC+bB+aA}{2abc} - \frac{c+b+a}{2abc}$ \\
%& $=$ & $\frac{3}{2abc} + \frac{cC+bB+aA}{2abc} - \frac{cC}{abc} \left \{ \frac{s_3 n}{C}\right \} - \frac{bB}{abc} \left \{ \frac{s_2 n}{B} \right \} - \frac{aA}{abc} \left \{ \frac{s_1 n}{A} \right \}$ \\
%& $=$ & $\frac{3}{2abc} + \frac{cC+bB+aA}{2abc} - \frac{1}{abc} \left ( cC \left \{ \frac{s_3 n}{C}\right \} + bB \left \{ \frac{s_2 n}{B} \right \} + aA \left \{ \frac{s_1 n}{A} \right \} \right )$ \\
%& $=$ & $\frac{3+aA+bB+cC}{2abc} - \frac{1}{2abc} \left ( 2cC \left \{ \frac{s_3 n}{C}\right \} + 2bB \left \{ \frac{s_2 n}{B} \right \} + 2aA \left \{ \frac{s_1 n}{A} \right \} \right )$ \\
%& $=$ & $\frac{3+aA+bB+cC - 2cC \left \{ \frac{s_3 n}{C}\right \} - 2bB \left \{ \frac{s_2 n}{B} \right \} - 2aA \left \{ \frac{s_1 n}{A} \right \}}{2abc}$ \\
%& $=$ & $\frac{3+aA \left ( 1-2\left \{ \frac{s_1 n}{A} \right \} \right )+bB \left ( 1 - 2 \left \{ \frac{s_2 n}{B} \right \} \right )+cC \left (1 - 2 \left \{ \frac{s_3 n}{C}\right \} \right )}{2abc}$
%\end{tabular}
%\end{center}
%\end{itemize}


%\begin{itemize}
%\item $\sum_{k=1}^{A-1} \frac{\omega_{A}^{kn}}{1 - \bar{\omega}_{A}^{ka}}$ \checkmark  We have done this!!
%\item $\sum_{k=1}^{A-1} \frac{\omega_{A}^{kn}}{(1 - \bar{\omega}_{A}^{ka})^2}$  This comes from $<1,1,A>$ then use the Fourier Transforms (dialation by $a$)
%\item $\sum_{k=1}^{A-1} \frac{\omega_{A}^{kn} \bar{\omega}_{A}^{ka}}{(1-\bar{\omega}_{A}^{ka})^2}$  As above plus modulation.
%\item $\sum_{\substack{k=1 \\ \frac{a}{B} \nmid k \\ \frac{a}{C} \nmid k}}^{a-1} \frac{\omega_{a}^{kn}}{(1-\bar{\omega}_{a}^{kb})(1-\bar{\omega}_{a}^{kc})}$ comes from the isosceles right triangle
%\end{itemize}

%(Side Note:  $R_1 \alpha = R_2 \beta = R_3 \gamma$ where $\alpha = BC, \beta = AC$ and $\gamma = AB$, find isosceles triangles info with these values.)

%{\bf {Modulation Transform:}} $\underset{A-periodic}{f(n)} = \sum_{k=0}^{A-1} \hat(f) (k) \omega_{A}^{kn}$  \hspace{30 pt}  $T_a (f) (n) = \sum_{k=0}^{A-1} \bar{\omega}_{A}^{ka} \hat{f} (k) \omega_{A}^{kn}$ where $M_{a} \hat{f} = \bar{\omega}_{A}^{ka}$.  \\

%$T_{a} (f) (n) = f(n \pm a)$?  (Which one? plus or minus?) \\

%Want $\sum_{k=1}^{b-1} \frac{\omega^{kn}}{(1 - \bar{\omega}_{A}^{ka})^2} =$?  $\gcd (a,b)=1$ \\

%From $<1,1,c>$, $\frac{1}{c} \sum_{k=1}^{c-1} \frac{\omega_{c}^{kn}}{(1 - \bar{\omega}_{c}^{ka})^2} = \frac{c-2}{2} \left \{ \frac{n}{c} \right \} - \frac{c}{2} \left \{ \frac{n}{c} \right \} ^2 - \frac{c-5}{12c} = f(n)$.  (Might be an error at $\frac{c-5}{12c}$) \\

%Also $f(n) = \sum_{k=0}^{c-1} \hat{f} (k) \omega^{kn}$ where $\omega = \omega_{c} \implies \hat{f} (k) = \frac{1}{c(1-\bar{\omega}_{c}^{k})^2}$  \\

%$U_s f(n) = f(sn)$, where $\gcd (c,s) = 1$ and $sa+tc = 1$ \\

%$<f,g> = \frac{1}{c} \sum_{n=0}^{c-1} f(n) \bar{g(n)}$ \\

%We have an orthonormal basis $\{ 0, \omega ^n, \omega ^{2n}, \ldots, \omega ^{(c-1)n} \}$  \hspace{45pt} $<f(n), \omega ^{kn}> = \hat{f} (k)$ \\

%\begin{tabular}{r c l}
%$\hat{(U_s f)} (k)$ & $=$ & $<(U_s f) (n), \omega ^{kn}> = \frac{1}{c} \sum_{n=0}^{c-1} f(sn) \bar{\omega}^{kn}$ \\
%Let $m = sn$, then we have & $=$ & $\frac{1}{c} \sum_{m=0}^{c-1} f(m) \bar{\omega}^{akm}$ since $as \equiv 1 \mod c$ \\
%& $=$ & $\hat{f} (ak)$
%\end{tabular}

%\begin{tabular}{r c l}
%$f(sn)$ & $=$ & $\frac{1}{c} \sum_{k=1}^{c-1} \frac{\omega^{ksn}}{(1 - \bar{\omega}^{k})^2}$ \\
%& $=$ & $\sum_{k=0}^{c-1} \hat{(U_s f)} (k) \omega^{kn}$ \\
%& $=$ & $\sum_{k=0}^{c-1} \hat{f} (ak) \omega^{kn}$ \\
%& $=$ & $\sum_{k=1}^{c-1} \frac{\omega^{kn}}{c(1-\bar{\omega}^{ak})^2}$ \\
%& $=$ & $\frac{c-2}{2} \left \{ \frac{n}{c} \right \} - \frac{c}{2} \left \{ \frac{n}{c} \right \} ^2 - \frac{c-5}{12c} = f(n)$
%\end{tabular}

\newpage

\chapter{Theorem (Brion and Lawrence - Varchenko)}

\section{Description and Proof}

In the paper written by Matthias Beck, Christian Haase and Frank Sottile named "Formulas of Brion Lawrence and Varchenko on Rational Generating Functions for Cones" \cite{BHS}, they discuss and prove two important thoerems which will be used in this research:  the theorems of Brion and Lawrence \& Varchenko.  A general example of the motivation for each of these theorems (first Lawrence \& Varchenko then Brion) is as follows: Consider the polytope $[a,b] \in \mathbb{R}$ where $a,b \in \mathbb{Z}$.  First we can take the difference of $2$ generating functions which list all integers less than $a$ and $b$ as follows:  Consider $x^a + x^{a-1} + \dots = \sum_{k \le a} x^k = \frac{x^a}{1-\frac{1}{x}}$ and $x^b + x^{b-1} + \dots = \sum_{k \le b} x^k = \frac{x^b}{1-\frac{1}{x}}$.  Now taking the difference of these we get:

\begin{center}
$x^b + x^{b-1} + \dots - (x^a + x^{a-1} + \dots) = \sum_{k \le b} x^k - \sum_{k \le a} x^k = \frac{x^b}{1-\frac{1}{x}} - \frac{x^a}{1-\frac{1}{x}} = x^b + x^{b-1} + \dots + x^a$,
\end{center}
which is a sum of $x$-terms whose exponents are all integers in the interval $[a,b]$. \\

We can now approach this in a slightly different way, but end up with the same result.  Let's list all of the integers {\bf{greater}} than $a$ in the form of a generating function:
\begin{center}  $x^a + x^{a+1} + \dots = \sum_{k \ge a} x^k = \frac{x^a}{1-x}$. \end{center}
We can also list all of the integers {\bf{less}} than $b$ in a similar way:
\begin{center}  $\dots + x^{b-1} + x^b = \sum_{k \le b} x^k = \frac{x^b}{1-\frac{1}{x}}$.  \end{center}
Now adding these together we get the following result:

\begin{center}
\begin{tabular}{r c l}
 $\frac{x^a}{1-x} + \frac{x^b}{1-\frac{1}{x}}$ & $=$ & $\frac{x^a}{1-x} + \frac{x^{b+1}}{x-1}$ \\
& $=$ & $\frac{x^a - x^{b+1}}{1-x}$ \\
& $=$ & $x^a + x^{a+1} + \dots + x^b$,
\end{tabular}
\end{center}
which is a sum of $x$-terms whose exponents are all integers in the interval $[a,b]$.  These approaches can be expanded into higher dimensions; specifically for the purposes of this research, can be expanded into $2$-dimensions.  Consider the following arbitrary triangle on the $x,y$-plane in Figure \ref{ArbitTri}:

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0) -- (5,0) node [right] {$x$};
\draw [->] (0,-1) -- (0,5) node [above] {$y$};
\draw[thick] (4,-1) -- (2,4) node [above] {$S$};
\draw[thick] (2,4) -- (1,2) node [left] {$R$};
\draw[thick] (1,2) -- (4,-1) node [below] {$T$};
\filldraw 
(3.7,-0.5) circle (2pt)
(3.2,0) circle (2pt)
(3.2,0.5) circle (2pt)
(2.7,0.5) circle (2pt)
(3.2,1) circle (2pt) 
(2.7,1) circle (2pt)
(2.7,1.5) circle (2pt) 
(2.7,2) circle (2pt)
(2.2,2) circle (2pt)
(2.2,1.5) circle (2pt)
(2.2,1) circle (2pt)
(2.2,2.5) circle (2pt)
(2.2,3) circle (2pt)
(2.2,3.5) circle (2pt)
(1.7,1.5) circle (2pt)
(1.7,2) circle (2pt)
(1.7,2.5) circle (2pt)
(1.7,3) circle (2pt)
(1.2,2) circle (2pt);
\end{tikzpicture}
\end{center}
\caption{Arbitrary Triangle with lattice points indicated}
\label{ArbitTri}
\end{figure}

\newpage

Approaching this in a similar way as the previous example, we can add/subtract closed, half-open and open cones together to count precisely the lattice points in this triangle, as in Figure \ref{LVProof}. 

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}[scale=0.9]
\draw[thick, ->] (0,0)  -- (3,0);
\draw[thick, ->] (0,0) -- (0,3);
\draw[thick] (2.4,-0.6) -- (1.2,2.4) node [above] {$S$};
\draw[thick] (1.2,2.4) -- (0.6,1.2) node [left] {$R$};
\draw[thick] (0.6,1.2) -- (2.4,-0.6) node [below] {$T$};
\draw (3,1.5) node [right] {$\bm{=}$}; 
\fill [gray] (2.4,-0.6) -- (1.2,2.4) -- (0.6,1.2);

\filldraw 
(2.4,-0.6) circle (2pt) 
(0.6,1.2) circle (2pt) 
(1.2,2.4) circle (2pt);

\draw[thick, ->] (4,0) -- (7,0);
\draw[thick] (4,0) -- (4,2);
%\fill [gray] (4,1.8) -- (6.4,-0.6) -- (4.96,3) -- (4,3);
\shade[left color=white, right color=gray, shading angle=10]
    (6.4,-0.6) -- (35mm,23mm) arc (-215:-263:20mm) -- cycle;
\draw[thick] (6.4,-0.6) -- (5.2,2.4) node [right] {$S$};
\draw[thick] (6.4,-0.6) node [below] {$T$} -- (4.6,1.2) node [below] {$R$};
\draw[thick, ->] (4.6,1.2) -- (3.5,2.3);
\draw[thick, ->] (5.2,2.4) -- (4.9,3.15);
\filldraw 
(5.2,2.4) circle (2pt)
(6.4,-0.6) circle (2pt)
(4.6,1.2) circle (2pt);
%\draw[dashed] (5.2,2.4) -- (4.6,1.2);
%\draw[thick, ->] (5,2) node [left] {$R$} -- (5,-0.5);
%\draw[thick, ->] (5,2) -- (10,-0.5);
\draw (7,1.5) node [right] {$\bm{-}$};

\draw[thick, ->] (8,0) -- (11, 0);
\draw[thick] (8,0) -- (8, 2);
%\draw[thick, ->] (11,0) -- (11,4);
%\fill [gray] (8.6,1.2) -- (8,1.8) -- (8,3) -- (9.5,3);
\shade[left color=white, right color=gray, shading angle=10]
    (8.6,1.2) -- (95mm,30mm) arc (75:140:20mm) -- cycle;

%\draw[dashed] (10.4,-0.6) -- (9.2,2.4) node [right] {$S$};
\draw[dashed] (9.2,2.4) -- (8.6,1.2) node [below] {$R$};
\draw (10.4,-0.6) circle (2pt) node[below] {$T$};
\draw (9.2,2.4) circle (2pt) node [right] {$S$};
%\draw[dashed] (8.6,1.2) -- (10.4,-0.6) node [below] {$T$};
\draw[thick, ->] (8.6,1.2) -- (7.5,2.3);
\draw[dashed, ->] (9.2,2.4) -- (9.5,3);

\filldraw [white]
(10.4,-0.6) circle (2pt)
(8.6,1.2) circle (2pt)
(9.2,2.4) circle (2pt);

\draw (10.4,-0.6) circle (2pt);
\draw (8.6,1.2) circle (2pt);
\draw (9.2,2.4) circle (2pt);

%\node at (10.4,-0.6) [circle,draw=black,fill=white] {};
%\node at (8.6,1.2) [circle,draw=black,fill=white] {};
%\node at (9.2,2.4) [circle,draw=black,fill=white] {};

\draw (11,1.5) node [right] {$\bm{+}$};

\draw[thick, ->] (12,0)  -- (15,0);
\draw[thick, ->] (12,0)  -- (12,3);

%\draw[dashed] (14.4,-0.6) -- (13.2,2.4) node [right] {$S$};
%\draw[dashed] (13.2,2.4) -- (12.6,1.2) node [left] {$R$};
%\draw[dashed] (12.6,1.2) -- (14.4,-0.6) node [below] {$T$};
%\draw (18,5) node {$C_O$}; 
%\fill [gray] (13.2,2.4) -- (13.5,3) -- (12.96,3);
\shade[left color=white, right color=gray, shading angle=10]
    (13.2,2.4) -- (135mm,30mm) arc (75:106:10mm) -- cycle;
\draw[dashed, ->] (13.2,2.4) -- (13.5,3);
\draw[dashed, ->] (13.2,2.4) -- (12.96,3);

%\filldraw 
%(14.4,-0.6) circle (2pt) 
%(12.6,1.2) circle (2pt) 
%(13.2,2.4) circle (2pt);

\filldraw [white]
(14.4,-0.6) circle (2pt)
(12.6,1.2) circle (2pt)
(13.2,2.4) circle (2pt);

\draw (14.4,-0.6) circle (2pt) node[below] {$T$};
\draw (12.6,1.2) circle (2pt) node [left] {$R$};
\draw (13.2,2.4) circle (2pt) node [right] {$S$};

\end{tikzpicture}
\end{center}
\caption{Cones for Lawrence-Varchenko Perspective}
\label{LVProof}
\end{figure}

%\begin{figure}[h]
%\begin{center}
%\begin{tikzpicture}
%\draw [->] (-1,0) -- (4,0) node [right] {$x$};
%\draw [->] (0,-1) -- (0,4) node [above] {$y$};
%\draw[thick] (3,0) -- (0,0);
%\draw[thick] (0,0) -- (0,3);
%\draw[thick] (0,3) -- (3,0);
%\filldraw 
%(0,0) circle (2pt) node[below left] {$(0,0)$}
%(1,0) circle (2pt) node[below] {$(1,0)$} 
%(2,0) circle (2pt) node[below] {$(2,0)$}
%(3,0) circle (2pt) node[below] {$(3,0)$}
%(0,1) circle (2pt) node[left] {$(0,1)$}
%(1,1) circle (2pt) node[below] {$(1,1)$}
%(2,1) circle (2pt) node[right] {$(2,1)$}
%(0,2) circle (2pt) node[left] {$(0,2)$}
%(1,2) circle (2pt) node[right] {$(1,2)$}
%(0,3) circle (2pt) node[left] {$(0,3)$};
%\end{tikzpicture}
%\end{center}
%\caption{Isosceles Right Triangle with vertex at the origin.}
%\label{IsoRightTriOrigin}
%\end{figure}

%When looking at this from the perspective of Lawrence-Varchenko, we would start off by considering the cone of the first quadrant.  Now since we need to remove some lattice points, so from the first quadrant, we will subtract the half open cone generated by the unit vector $\begin{bmatrix} 0 & 1 \end{bmatrix}$ and $\begin{bmatrix} 1 & -1 \end{bmatrix}$, at vertex $(0,3)$, as shown in Figure \ref{LV2}

%\begin{figure}[h]
%\begin{center}
%\begin{tikzpicture}
%\draw [->] (-1,0) node [left] {$x$}-- (4,0);
%\draw [->] (0,-1) node [below] {$y$}-- (0,4);
%\draw[blue, thick, dashed, ->] (0,3) -- (4,-1);
%\draw[blue, thick, ->] (0,3) -- (0,4);
%\draw (0,3) node [left] {$(0,3)$};
%\fill [blue] (0,3) -- (4,-1) -- (4,4) -- (0,4);

%\end{tikzpicture}
%\end{center}
%\caption{Removing unneeded lattice points from First Quadrant}
%\label{LV2}
%\end{figure}

%However, now we have removed too many lattice points, specifically, the lattice points below the $x$-axis.  Thus, we will need to add back in the open cone generated by the unit vector $\begin{bmatrix} 1 & 0 \end{bmatrix}$ and $\begin{bmatrix} 1 & -1 \end{bmatrix}$, at vertex $(3,0)$, as shown in Figure \ref{LV3}.

%\begin{figure}[h]
%\begin{center}
%\begin{tikzpicture}
%\draw (-1,0) node [left] {$x$}-- (3,0);
%\draw [->] (0,-1) node [below] {$y$}-- (0,4);
%\draw[thick, dashed, ->] (3,0) -- (4,-1);
%\draw[thick, dashed, ->] (3,0) -- (4,0);
%\draw (3,0) node [above right] {$(3,0)$};
%\fill [gray] (3,0) -- (4,-1) -- (4,0);

%\end{tikzpicture}
%\end{center}
%\caption{Adding back in lattice points from Fourth Quadrant}
%\label{LV3}
%\end{figure}

%Now all the lattice points that we have left is exactly the lattice points our original isosceles triangle.

Note that this was an arbitrary triangle in $2$-dimensions.  Since this is the focus of this paper, for our purposes, this proves Lawrence-Verchenko whose statement is as follows:

\begin{theorem}

Let $P$ be a simple polytope, and for each vertex $v$ of $P$ choose a vector $\epsilon _v$ that is not perpendicular to any edge direction at $v$.  Form the cone $K_{\epsilon_v ,v}$.  Then we have 

\begin{center}  $\sigma_P (x) = \sum_{v \text{ a vertex of } P}  (-1)^{|E_v^- (\epsilon_v)|} \sigma_{K_{\epsilon_v ,v}}$,  \end{center}

where 

\begin{itemize}
\item  $E_v^-(\epsilon)$ is the edge directions $w$ at vertex $v$ with $w \cdot \epsilon < 0$.
\item  $E_v^+(\epsilon)$ is the edge directions $w$ at vertex $v$ with $w \cdot \epsilon > 0$.
\item  $K_{\epsilon, v} := v + \sum_{w \in E_v^+(\epsilon)} \mathbb{R}_{\ge 0} w + \sum_{w \in E_v^-(\epsilon)} \mathbb{R}_{< 0} w$.
\item  $\sigma_K$ is the generating function encoding the lattice points in the cone $K$.

\end{itemize}

\end{theorem}

When looking at this from the perspective of Brion, at each vertex in Figure \ref{ArbitTri}, we can create a cone with each vertex and its adjacent sides, as follows:

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}[scale=0.9]

\draw[thick, ->] (0,0)  -- (3,0);
\draw[thick, ->] (0,0) -- (0,3);
\draw[thick] (2.4,-0.6) -- (1.2,2.4) node [above] {$S$};
\draw[thick] (1.2,2.4) -- (0.6,1.2) node [left] {$R$};
\draw[thick] (0.6,1.2) -- (2.4,-0.6) node [below] {$T$};
\draw (3,1.5) node [right] {$\bm{=}$}; 
\fill [gray] (2.4,-0.6) -- (1.2,2.4) -- (0.6,1.2);

\draw[thick, ->] (4,0) -- (7,0);
\draw[thick] (4,0) -- (4,2);
%\fill [gray] (4,1.8) -- (6.4,-0.6) -- (4.96,3) -- (4,3);
\shade[left color=white, right color=gray, shading angle=10]
    (6.4,-0.6) -- (35mm,23mm) arc (-215:-263:20mm) -- cycle;

\draw[thick] (6.4,-0.6) -- (5.2,2.4) node [right] {$S$};
\draw[thick] (6.4,-0.6) node [below] {$T$} -- (4.6,1.2) node [below] {$R$};
\draw[thick, ->] (4.6,1.2) -- (3.5,2.3);
\draw[thick, ->] (5.2,2.4) -- (4.9,3.15);
\draw[dashed] (5.2,2.4) -- (4.6,1.2);
\filldraw 
(5.2,2.4) circle (2pt)
(6.4,-0.6) circle (2pt)
(4.6,1.2) circle (2pt);
%\draw[thick, ->] (5,2) node [left] {$R$} -- (5,-0.5);
%\draw[thick, ->] (5,2) -- (10,-0.5);
\draw (7,1.5) node [right] {+};

\draw[thick, ->] (8,0) -- (11, 0);
\draw[thick, ->] (8,0) -- (8, 3);
%\draw[thick, ->] (11,0) -- (11,4);
%\fill [gray] (9.2,2.4) -- (7.5,-1) -- (10.56,-1);
\shade[left color=gray, right color=white, shading angle=10]
    (9.2,2.4) -- (75mm,-10mm) arc (215:326:18.5mm) -- cycle;

\draw[dashed] (8.6,1.2) -- (10.4,-0.6) node [right] {$T$};
\draw[thick] (9.2,2.4) node [right] {$S$} -- (10.4,-0.6);
\draw[thick] (9.2,2.4) -- (8.6,1.2) node [above left] {$R$};
\draw[thick, ->] (8.6,1.2) -- (7.5,-1);
\draw[thick, ->] (10.4, -0.6) -- (10.56,-1);
\filldraw 
(9.2,2.4) circle (2pt)
(10.4,-0.6) circle (2pt)
(8.6,1.2) circle (2pt);

\draw (11,1.5) node [right] {+};

\draw[thick, ->] (12,0)  -- (15,0);
\draw[thick, ->] (12,0)  -- (12,3);
%\draw (18,5) node {$C_O$}; 
%\fill [gray] (12.6,1.2) -- (13.5,3) -- (15,3) -- (15,-1) -- (14.8,-1);
\shade[left color=gray, right color=white, shading angle=90]
    (12.6,1.2) -- (148mm,-10mm) arc (-45:81:23.5mm) -- cycle;
    
\draw[thick] (13.2,2.4) -- (12.6,1.2) node [left] {$R$};
\draw[thick] (12.6,1.2) -- (14.4,-0.6) node [below] {$T$};
\draw[thick, ->] (13.2,2.4) -- (13.5,3);
\draw[thick, ->] (14.4,-0.6) -- (14.8,-1);
\draw[dashed] (14.4,-0.6) -- (13.2,2.4) node [left] {$S$};
\filldraw 
(13.2,2.4) circle (2pt)
(14.4,-0.6) circle (2pt)
(12.6,1.2) circle (2pt);
\end{tikzpicture}
\end{center}
\caption{Cones for Brion Perspective}
\label{BrionProof}
\end{figure}

For each of the cones in Figure \ref{BrionProof}, we can once again list all of the lattice points, in the cone, in the form of a Hilbert Series, using the fundamental parallelograms which are generated by vectors, of latticial length $1$, denoted by $\begin{bmatrix}  a_{IJ} & b_{IJ} \end{bmatrix}$, where $IJ$ is the line segment corresponding to a side of the cone.  Let $FP_V$ denote the fundamental parallelogram of cone $K_V$; $P_V (x)$ denote the polynomial, with exponents representing each lattice point in the fundamental parallelogram, of the cone $K_V$, which has vertex $V$.

\begin{itemize}
\item  Lattice Points in $C_{R}$:  $\sum_{(k,l) \in C_{R} \cap \mathbb{Z} } x^k y^l = \frac{P_R (x)}{(1-x^{a_{RS}} y^{b_{RS}})(1-x^{a_{RT}} y^{b_{RT}})}$, similarly
\item  Lattice Points in $C_{S}$:  $\sum_{(k,l) \in C_{S} \cap \mathbb{Z} } x^k y^l = \frac{P_S (x)}{(1-x^{-a_{RS}} y^{-b_{RS}})(1-x^{a_{ST}} y^{b_{ST}})}$, and 
\item  Lattice Points in $C_{T}$:  $\sum_{(k,l) \in C_{T} \cap \mathbb{Z} } x^k y^l = \frac{P_T (x)}{(1-x^{-a_{RT}} y^{-b_{RT}})(1-x^{-a_{ST}} y^{-b_{ST}})}$.
\end{itemize}
Now, when we add these rational expressions together, we get the following result:

\begin{center}
\begin{tabular} {r l}
& $\frac{P_R (x)}{(1-x^{a_{RS}} y^{b_{RS}})(1-x^{a_{RT}} y^{b_{RT}})} + \frac{P_S (x)}{(1-x^{-a_{RS}} y^{-b_{RS}})(1-x^{a_{ST}} y^{b_{ST}})}$ \\
& $+ \frac{P_T (x)}{(1-x^{-a_{RT}} y^{-b_{RT}})(1-x^{-a_{ST}} y^{-b_{ST}})}$ \\
$=$ & $\frac{P_R (x)}{(1-x^{a_{RS}} y^{b_{RS}})(1-x^{a_{RT}} y^{b_{RT}})} - \frac{x^{a_{RS}} y^{b_{RS}} P_S (x)}{(1-x^{a_{RS}} y^{b_{RS}})(1-x^{a_{ST}} y^{b_{ST}})}$ \\
& $+ \frac{x^{a_{RT}} y^{b_{RT}} x^{a_{ST}} y^{b_{ST}} P_T (x)}{(1-x^{a_{RT}} y^{b_{RT}})(1-x^{a_{ST}} y^{b_{ST}})}$ \\
\end{tabular}
\end{center} 
%When looking at the exponents for each of these terms, these are precisely the coordinates of the lattice point in Figure \ref{ArbitTri}.  Furthermore, this is consistent with Pick's Theorem, as the area of this triangle is $\frac{9}{2}$ and the number of lattice points on the boundary is $9$, thus Pick's Theorem tells us that
%\begin{center}  $| P \cap \mathbb{Z} | = \frac{9}{2} +  \frac{1}{2} \times 9+ 1 = 10$.  \end{center}

Note that the first rational expression remains unchanged, hence it still calculates the lattice points in $K_R$ in Figure \ref{BrionProof}.  The second rational expression is now calculating the lattice points in the shaded region of Figure \ref{UpdatedCS}.  Similarly, the third rational expression is now calculating the lattice points in the shaded region of Figure \ref{UpdatedCT}. \\

\begin{figure}[H]
\begin{center}
\begin{tikzpicture}

\draw[thick, ->] (8,0) -- (11, 0);
\draw[thick, ->] (8,0) -- (8, 3);
%\draw[thick, ->] (11,0) -- (11,4);
%\fill [gray] (9.2,2.4) -- (10.2,4.4) -- (10.56,-1);
\shade[left color=gray, right color=white, shading angle=90]
    (9.2,2.4) -- (105.6mm,-10mm) arc (-45:52.5:36mm) -- cycle;
  \draw[thick] (9.2,2.4) node [left] {$S$} -- (10.4,-0.6);
\draw[dashed] (9.2,2.4) -- (8.6,1.2) node [above left] {$R$};
\draw[thick, ->] (9.2,2.4) -- (10.2,4.4);
\draw[thick, ->] (10.4, -0.6) -- (10.56,-1);
\draw[dashed] (8.6,1.2) -- (10.4,-0.6) node [below left] {$T$};
\draw (12,1.5) node [right] {,};

\end{tikzpicture}
\end{center}
\caption{Region $\frac{x^{a_{RS}} y^{b_{RS}} P_S (x)}{(1-x^{a_{RS}} y^{b_{RS}})(1-x^{a_{ST}} y^{b_{ST}})}$ is counting lattice points.}
\label{UpdatedCS}
\end{figure}

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}

\draw[thick, ->] (4,0) -- (7,0);
\draw[thick, ->] (4,0) -- (4,3);

%\fill [gray] (6.4,-0.6) -- (7.4,-1.6) -- (7.4,-3.1);
\shade[left color=gray, right color=white, shading angle=90]
    (6.4,-0.6) -- (74mm,-31mm) arc (-45:0:15mm) -- cycle;
   
\draw[dashed] (6.4,-0.6) -- (5.2,2.4) node [right] {$S$};
\draw[dashed] (6.4,-0.6) node [below] {$T$} -- (4.6,1.2) node [below] {$R$};
\draw[thick, ->] (6.4,-0.6) -- (7.85,-2.05);
\draw[thick, ->] (6.4,-0.6) -- (7.4,-3.1);
\draw[dashed] (5.2,2.4) -- (4.6,1.2);
%\draw[thick, ->] (5,2) node [left] {$R$} -- (5,-0.5);
%\draw[thick, ->] (5,2) -- (10,-0.5);

\end{tikzpicture}
\end{center}
\caption{Region $\frac{x^{a_{RT}} y^{b_{RT}} x^{a_{ST}} y^{b_{ST}} P_T (x)}{(1-x^{a_{RT}} y^{b_{RT}})(1-x^{a_{ST}} y^{b_{ST}})}$ is counting lattice points.}
\label{UpdatedCT}
\end{figure}

Note that when performing the operations given in the regional expression above, this matches up exactly with the Lawrence-Varchenko approach to the same triangle.  Further note that since this was an arbitrary triangle in $2$-dimensions, which is the focus of this paper, for our purposes, this proves Brion, whose statement is as follows:

\begin{theorem}[Brion's Theorem]

Let $P$ be a polytope with rational vertices $v_1, v_2, \ldots, v_d$.  Let $K_{v_i}$ denote the vertex cone for $i \in \{1, 2, \ldots, d \}$, and let $\sigma_{K_{v_i}} (x,y)$ be the rational function representing the integer points in the vertex cone $K_{v_i}$.  Then
\begin{center}  $\sigma_{P} (x,y) = \sum_{v_i \text{ a vertex of } P} \sigma_{K_{v_i}} (x,y)$, \end{center}
where $\sigma_{P} (x,y)$ is the polynomial encoding the integer points in $P$.

\end{theorem}

\noindent{For proofs of these theorems with arbitrary dimension, please see \cite{BHS}.}

\chapter{$f(n)$ using Partial Fraction}

\section{Quick example with monoid $<1,b>$}

Consider the monoid $<1,b>$.  Then

\begin{center}
$\sum_{n=0}^{\infty} f_{<1.b>} (n) z^n = \frac{1}{(1-z)(1-z^b)} = \frac{B_2}{(1-z)^2} + \frac{B_1}{1-z} + \sum_{\substack{\omega^b=1 \\ \omega \neq 1}} \frac{D^{\omega}}{(1-\omega z)}$ \\
\end{center}

\begin{tabular}{r c l}
$B_2$ & $=$ & $\lim_{z \longrightarrow 1} \frac{(1-z)^2}{(1-z)(1-z^b)}$ \\
& $=$ & $\lim_{z \longrightarrow 1} \frac{1}{b_z} = \frac{1}{b}$ 
\end{tabular}

\begin{tabular}{r c l}
$B_1$ & $=$ & $\lim_{z \longrightarrow 1} \left [ \frac{(1-z)}{(1-z)(1-z^b)} - \frac{1}{b(1-z)} \right]$ \\
& $=$ & $\lim_{z \longrightarrow 1} \left [ \frac{b - b_z }{b(1-z^b)} \right ]$ \\
& $\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 1} \frac{1+2z+3z^2+\dots+(b-1)z^{b-2}}{b^2 z^{b-1}}$ \\
& $=$ & $\frac{\frac{b(b-1)}{2}}{b^2} = \frac{b-1}{2b}$
\end{tabular}

\begin{tabular}{r c l}
$D^{\omega}$ & $=$ & $\lim_{z \longrightarrow \bar{\omega}} \frac{1-\omega z}{(1-z)(1-z^b)}$ \\
& $\stackrel{(*)}{=}$ & $\lim_{x \longrightarrow 1} \frac{1-x}{(1-(\bar{\omega} x))(1-(\bar{\omega} x)^b)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{1-x}{(1-\bar{\omega}x)(1- x^b)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{1-x}{(1-\bar{\omega} x) b_x (1- x)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{1}{b_x (1- \bar{\omega} x)}$ \\
& $=$ & $\frac{1}{b(1-\bar{\omega})}$
\end{tabular}

(*) This is equal by substituting $x = \omega z$, then $z = \bar{\omega} x$ and when $z \longrightarrow \bar{\omega}$, then $x \longrightarrow 1$. 

\noindent{Thus we have that }

\begin{tabular}{r c l}
$\frac{1}{(1-z)(1-z^b)}$ & $=$ & $\frac{1}{b(1-z)^2} + \frac{b-1}{2b(1-z)} + \frac{1}{b} \sum_{k=1}^{b-1} \frac{1}{(1-\bar{\omega}^k)(1-\omega^k z)}$ \\
& & where $\omega = \omega _b = e^{\frac{i 2\pi}{b}}$ \\
& & and $\{ \alpha \in \mathbb{C} | \alpha^b = 1, \alpha \neq 1 \} = \{ \omega , \omega ^2 , \ldots , \omega ^{b-1} \}$ \\
& $=$ & $\sum_{n=0}^{\infty} \frac{1}{b} (n+1) z^n + \frac{b-1}{2b} \sum_{n=0}^{\infty} z^n + \sum_{n=0}^{\infty} \frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega ^{kn} z^n}{(1-\bar{\omega}^k)}$. 
\end{tabular}

\noindent{So}
\begin{center}
\begin{tabular}{r c l}
$f_{<1,b>} (n)$ & $=$ & $ \frac{n+1}{b} + \frac{b-1}{2b} + \frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega ^{kn}}{1-\bar{\omega}^k}$ \\
& $=$ & $\frac{n}{b} + \frac{1}{2b} + \frac{1}{2} + \frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega ^{k}}{1-\bar{\omega}^k}$ \\
& & Note that $\frac{1}{2b} + \frac{1}{2}$ is constant and $\frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega ^{k}}{1-\bar{\omega}^k}$ is\\
& & $b$-periodic and $0$-average. \\
& $\stackrel{(Popoviciu)}{=}$ & $\frac{n}{b} - \left \{ \frac{n}{b} \right \} + 1$, since $1 \times 1 + 0 \times b = 1$ \\
& $=$ & $\frac{n}{b} + \frac{b-1}{2b} - \left \{ \frac{n}{b} \right \} - \frac{b-1}{2b} + 1$ \\
& & Note that $\frac{b-1}{2b} - \left \{ \frac{n}{b} \right \}$ is $b$-periodic with $0$-average \\
\end{tabular}
\end{center}
Therefore, $\frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega ^k}{1-\bar{\omega}^k} = \frac{b-1}{2b} - \left \{ \frac{n}{b} \right \}$. \\

%Let's call the left side of this equality $\varphi (n)$ and note that $\varphi (n)$ is a $b$-periodic function with $0$-average.  Furthermore, note that $\hat{\varphi} (k) = \frac{1}{b(1-\bar{\omega}^k)}$. %(Should the bottom be $b(1-\bar{\omega}^n)$?  $n$ not $k$?)

%Let $\psi (n) := \left \{ \frac{n}{b}\right \}$, then $\hat{\psi} (k) =
 %\left\{
 % \begin{array}{@{}ll@{}}
 %   \frac{b-1}{2b}, & k=0 \\
 %   \frac{-1}{b(1-\bar{\omega}^k)}, & k \neq 0
 % \end{array}\right. $, from the following points:\\

%How about $\frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega ^{kn}}{(1-\bar{\omega}^{ak})}$? \\

%\hl{$k^{\text{th}}$ Fourier coefficient} $= \frac{1}{b(1 - \bar{\omega}^{ak})}$ (recall this is the coefficient of $\omega^{kn}$)

%\hl{Want to change $k$ into $sk$} \\

%$\vdots$  \\
%$\vdots$  \\

%$\implies \frac{1}{b} \sum_{k=1}^{b-1} \frac{\omega ^{kn}}{1-\bar{\omega}^{ak}} = \frac{b-1}{2b} - \left \{ \frac{sn}{b} \right \}$, via dilation. \\

%\hl{ Need to highlight this:}  $f_{<1,1,c>} (n) = \frac{n^2}{2c} + \left ( \frac{1}{c} + \frac{1}{2} \right ) n + 1 + \frac{c-2}{2} \left \{ \frac{n}{c} \right \} - \frac{c}{2} \left \{  \frac{n}{c} \right \} ^2 = \frac{1}{c} {{n+2} \choose 2} + \frac{c-1}{2c} (n+1) +$  (need to finish) \\

%Note that the average for $\left \{ \frac{n}{c} \right \}$ is $\frac{c-2}{2} \frac{c-1}{2c}$ and the average for $\left \{  \frac{n}{c} \right \} ^2$ is $\frac{c}{2} \frac{(c-1)(2c-1)}{6c^2}$. \\

%Average of constant term is $1 + \frac{(c-1)(c-5)}{12c} = \frac{(c+1)(c+5)}{12c}$ \\

%{\underline{Want:}} $\frac{1}{c} \sum_{k=1}^{c} \frac{\omega ^{kn}}{(1-\bar{\omega}^k)^2} =$ in terms of $\left \{ \frac{n}{c} \right \} \stackrel{(T_b shift)}{\implies} \frac{1}{c} \sum_{k=1}^{c} \frac{\omega^{kbn}}{(1-\bar{\omega}^{kb})^2}$

%{\underline{Want:}} $\sum_{k=1}^{c} \frac{\omega^{kn}}{(1-\bar{\omega}^{ka})(1-\bar{\omega}^{kb})} =$ fractional parts $\left \{ \frac{sn}{c} \right \}, \left \{ \frac{tn}{c} \right \} , \ldots$

\section{Example with monoid $<a,A>$}

Next consider the monoid $<a,A>$.  Then

\begin{center}  $\sum_{\substack{n=0}}^{\infty} f_{<a,A>} (n) z^n = \frac{1}{(1-z^a)(1-z^A)} = \frac{B_2}{(1-z)^2} + \frac{B_1}{1-z} + \sum_{\substack{w^a=1 \\ w \neq 1}} \frac{C^{\omega}}{(1-\omega z)} + \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{D^{\omega}}{(1-\omega z)}$ \end{center}

\begin{tabular}{r c l}
$B_2$ & $=$ & $\lim_{z \longrightarrow 1} \frac{(1-z)^2}{(1-z^a)(1-z^A)}$ \\
& $=$ & $\lim_{z \longrightarrow 1} \frac{1}{a_z A_z}$ \\
& $=$ & $\frac{1}{aA}$ 
\end{tabular}

\begin{tabular}{r c l}
$B_1$ & $=$ & $\lim_{z \longrightarrow 1} \left [ \frac{(1-z)}{(1-z^a)(1-z^A)} - \frac{1}{aA(1-z)} \right]$ \\
& $\stackrel{(*)}{=}$ & $\lim_{x \longrightarrow 1} \frac{x}{(1-(1-x)^a)(1-(1-x)^A)} - \frac{1}{aAx}$ \\
& $=$ & $\lim_{x \longrightarrow 0} \frac{x}{a_{(1-x)} A_{(1-x)} x^2} - \frac{1}{aAx}$ \\
& $=$ & $\lim_{x \longrightarrow 0} \frac{aA-a_{(1-x)} A_{(1-x)}}{a_{(1-x)} A_{(1-x)} xaA}$ \\
& $=$ & $\frac{1}{(aA)^2} \lim_{x \longrightarrow 0} \frac{aA - a_{(1-x)} A_{(1-x)}}{x}$ \\
& $\stackrel{(LH)}{=}$ & $\frac{1}{(aA)^2} \lim_{x \longrightarrow 0} -[a_{(1-x)}' A_{(1-x)} + a_{(1-x)} A_{(1-x)}']$ \\
& $=$ & $\frac{1}{(aA)^2} \left [ \frac{(a-1)a}{2} A + a \frac{(a-1)A}{2} \right ] $ \\
& $=$ & $\frac{aA [(a-1) + (A-1)]}{2(aA)^2}$ \\
& $=$ & $\frac{a+A-2}{2aA}$
\end{tabular}
\\
(*) This is equal by substituting $x = 1-z$, i.e. $z=1-x$.  Note that when $z \longrightarrow 1$, then $x \longrightarrow 0$. 

\begin{tabular}{r c l}
$C^{\omega}$ & $=$ & $\lim_{z \longrightarrow \bar{\omega}} \frac{1-\omega z}{(1-z^a)(1-z^A)}$ \\
& $\stackrel{(**)}{=}$ & $\lim_{x \longrightarrow 1} \frac{1-x}{(1-(\bar{\omega} x)^a)(1-(\bar{\omega} x)^A)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{1-x}{(1-x^a)(1-\bar{\omega} ^A x^A)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{1-x}{(1-x) a_x (1-\bar{\omega} ^A x^A)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{1}{a_x (1- \bar{\omega} ^A x^A)}$ \\
& $=$ & $\frac{1}{a(1-\bar{\omega}^A)}$
\end{tabular}
\\
(**) This is equal by substituting $x = \omega z$, then $z = \bar{\omega} x$ and when $z \longrightarrow \bar{\omega}$, then $x \longrightarrow 1$.  Similarly, $D^{\omega} = \frac{1}{A(1-\bar{\omega} ^a)}$.

So we have 
\begin{center}
\begin{tabular}{r c l}
$\sum_{n=0}^{\infty} f_{<a,A>} (n) z^n$ & $=$ & $\frac{1}{(1-z^a)(1-z^A)}$ \\
& $=$ & $\frac{1}{aA(1-z)^2} + \frac{a+A-2}{2aA(1-z)} + \sum_{\substack{w^a=1 \\ w \neq 1}} \frac{1}{a(1-\bar{\omega}^A)(1-\omega z)}$ \\
& & $+ \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{1}{A(1-\bar{\omega}^a)(1-\omega z)}$
\end{tabular}
\end{center}
Note that:

\begin{itemize}
\item $\frac{1}{1-z} = \sum_{n=0}^{\infty} \binom{n+0}{0} z^n = \sum_{n=0}^{\infty} z^n$
\item $\frac{1}{(1-z)^2} = \sum_{n=0}^{\infty} \binom{n+1}{1} z^n = \sum_{n=0}^{\infty} (n+1)z^n$ 
\item $\frac{1}{(1-\omega z)} = \sum_{n=0}^{\infty} \binom{n+0}{0} (\omega z)^n = \sum_{n=0}^{\infty} \omega ^n z^n$
\end{itemize}
Thus

\begin{tabular}{r c l}
$f_{<a,A>} (n)$ & $=$ & $\frac{n}{aA} + \frac{a+A-2}{2aA} + \frac{1}{aA} + \sum_{\substack{w^a=1 \\ w \neq 1}} \frac{\omega ^n}{a(1-\bar{\omega} ^A)} + \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{A(1-\bar{\omega} ^a)}$ \\
& $=$ & $\frac{n}{aA} + \frac{a+A}{2aA} + \sum_{\substack{w^a=1 \\ w \neq 1}} \frac{\omega ^n}{a(1-\bar{\omega} ^A)} + \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{A(1-\bar{\omega} ^a)}$ \\
& $=$ & $\frac{n}{aA} + \frac{a+A}{2aA} + \frac{1}{a} \sum_{\substack{w^a=1 \\ w \neq 1}} \frac{\omega ^n}{(1-\bar{\omega} ^A)} + \frac{1}{A} \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{(1-\bar{\omega} ^a)}$ \\
& $=$ & $\frac{n}{aA} + \frac{1}{2A} + \frac{1}{2a} + \frac{1}{a} \sum_{\substack{w^a=1 \\ w \neq 1}} \frac{\omega ^n}{(1-\bar{\omega} ^A)} + \frac{1}{A} \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{(1-\bar{\omega} ^a)}$
\end{tabular}

\noindent{Also note, by using Popoviciu,}

\begin{tabular}{r c l}
$f_{<a,A>} (n)$ & $=$ & $\frac{n}{aA} - \left \{ \frac{t_A n}{a} \right \} - \left \{ \frac{s_a n}{A} \right \} + 1$
\end{tabular}
where $s_a a + t_A A = 1$, i.e. $t_A A \equiv 1 \mod a$ and $s_a a \equiv 1 \mod A$. \\ %(Could use $s_1$ and $t_a$ to relate back to original $s_1, s_2, s_3$, i.e. $s_1 a + s_2 b + s_3 c = 1$.) \\
Note that
\begin{center}  $\frac{1}{A} \sum_{n=0}^{A-1} \left \{ \frac{s_a n}{A} \right \} = \frac{1}{A} \sum_{n=0}^{A-1} \frac{n}{A} =\frac{A(A-1)}{2A^2} = \frac{A-1}{2A} = \frac{1}{2} - \frac{1}{2A}$ \end{center}.
Similarly,
\begin{center}  $\frac{1}{a} \sum_{n=0}^{a-1} \left \{ \frac{t_A n}{a} \right \} = \frac{1}{a} \sum_{n=0}^{a-1} \frac{n}{a} =\frac{a(a-1)}{2a^2} = \frac{a-1}{2a} = \frac{1}{2} - \frac{1}{2a}$ \end{center}.
Hence,

\begin{tabular}{r c l}
$f_{<a,A>} (n)$ & $=$ & $\frac{n}{aA} - \left \{ \frac{t_A n}{a} \right \} + \left ( \frac{1}{2} - \frac{1}{2a} \right ) + \left ( - \frac{1}{2} + \frac{1}{2a} \right ) - \left \{ \frac{s_1 n}{A} \right \}$ \\
& & $+ \left ( \frac{1}{2} - \frac{1}{2A} \right ) + \left ( - \frac{1}{2} + \frac{1}{2A} \right ) + 1$.
\end{tabular}

\noindent{So,}
\begin{tabular}{r c l}
$f_{<a,A>} (n)$ & $=$ & $\frac{n}{aA} - \left \{ \frac{t_A n}{a} \right \} + \left ( \frac{1}{2} - \frac{1}{2a} \right ) - \left \{ \frac{s_1 n}{A} \right \} + \left ( \frac{1}{2} - \frac{1}{2A} \right ) + \frac{1}{2a}$ \\
& & $+ \frac{1}{2A}$
\end{tabular}

\noindent{Note that} 
\begin{itemize}
\item $- \left \{ \frac{t_A n}{a} \right \} + \left ( \frac{1}{2} - \frac{1}{2a} \right )$ is $a$-periodic, with $0$-average and
\item $- \left \{ \frac{s_a n}{A} \right \} + \left ( \frac{1}{2} - \frac{1}{2A} \right )$ is $A$-periodic, with $0$-average.
\end{itemize}
Therefore, since they are both $a$-periodic and $0$-average,

\begin{center} $- \left \{ \frac{t_A n}{a} \right \} + \left ( \frac{1}{2} - \frac{1}{2a} \right ) = \frac{1}{a} \sum_{\substack{w^a=1 \\ w \neq 1}} \frac{\omega ^n}{1-\bar{\omega}^A}$ or $\sum_{\substack{w^a=1 \\ w \neq 1}} \frac{\omega ^n}{1-\bar{\omega}^A} = -a \left \{ \frac{t_A n}{a} \right \} + \frac{a}{2} - \frac{1}{2}$ \end{center}
Similarly, since they are both $A$-periodic and $0$-average,

\begin{center} $- \left \{ \frac{s_a n}{A} \right \} + \left ( \frac{1}{2} - \frac{1}{2A} \right ) = \frac{1}{A} \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{1-\bar{\omega}^a}$ or $\sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{1-\bar{\omega}^a} = -A \left \{ \frac{s_a n}{A} \right \} + \frac{A}{2} - \frac{1}{2}$ \end{center}

\section{Partial Fractions of $f_{<a,b,c>}$}

When considering a numerical monoid $<a_1, a_2, \ldots, a_d>$, then we know that
\begin{center}  $\sum_{n=0}^{\infty} f_{<a_1, a_2, \ldots, a_d>} (n) z^n = \frac{1}{(1-z^{a_1})(1-z^{a_2}) \dots (1-z^{a_d})}$ \end{center}
where $f_{<a_1, a_2, \ldots, a_d>} (n) = \#$ of ways to get $n$ using $a_1, a_2, \ldots, a_d$.  In our case, we will be considering this when $M=<a,b,c>$, i.e.
\begin{center}  $\sum_{n=0}^{\infty} f_{<a, b, c>} (n) z^n = \frac{1}{(1-z^a)(1-z^b)(1-z^c)}$ \end{center}
where $f_{<a, b, c >} (n) = \#$ of ways to get $n$ using $a, b, c$.  Using partial fraction techniques, we can consider the following:

\begin{center}
\begin{tabular} {r c l}
$\sum_{n=0}^{\infty} f_{<a, b, c>} (n) z^n$ & $=$ & $ \frac{1}{(1-z^a)(1-z^b)(1-z^c)} = \frac{B_1}{1-z} + \frac{B_2}{(1-z)^2} + \frac{B_3}{(1-z)^3}$ \\
& & $+ \sum_{\substack{w^a=1 \\ w^b=1 \\ w^c \neq 1}} \left ( \frac{C_2^{\omega}}{(1-\omega z)^2} + \frac{C_1^{\omega}}{(1-\omega z)}\right )$ \\
& & $+ \sum_{\substack{w^a=1 \\ w^c=1 \\ w^b \neq 1}} \left ( \frac{D_2^{\omega}}{(1-\omega z)^2} + \frac{D_1^{\omega}}{(1-\omega z)}\right )$ \\
& & $+ \sum_{\substack{w^b=1 \\ w^c=1 \\ w^a \neq 1}} \left ( \frac{E_2^{\omega}}{(1-\omega z)^2} + \frac{E_1^{\omega}}{(1-\omega z)}\right ) + \sum_{\substack{w^a=1 \\ w^b \neq 1 \\ w^c \neq 1}} \frac{F_{\omega}}{(1-\omega z)}$ \\
& & $+ \sum_{\substack{w^b=1 \\ w^a \neq 1 \\ w^c \neq 1}} \frac{G_{\omega}}{(1-\omega z)} + \sum_{\substack{w^c=1 \\ w^a \neq 1 \\ w^b \neq 1}} \frac{H_{\omega}}{(1-\omega z)}$ \\
\end{tabular}
\end{center}
So, we will now calculate the coefficients:

\begin{tabular} { r c l}
$ \bullet$ $B_3$ & $=$ & $\lim_{z \longrightarrow 1} \frac{(1-z)^3}{(1-z^a)(1-z^b)(1-z^c)}$ \\
& $=$ & $\lim_{z \longrightarrow 1} \frac{(1-z)^3}{(1-z) a_z (1-z) b_z (1-z) c_z}$ \\
&  $=$ & $\lim_{z \longrightarrow 1} \frac{1}{a_z b_z c_z} = \frac{1}{abc}$
\end{tabular}
 
\begin{tabular} {r c l }
$ \bullet$ $B_2$ & $=$ & $\lim_{z \longrightarrow 1} \left [ \frac{(1-z)^2}{(1-z^a)(1-z^b)(1-z^c)} - \frac{1}{abc (1-z)} \right ]$ \\
& $=$ & $\lim_{z \longrightarrow 1} \left [ \frac{1}{a_z b_z c_z (1-z)} - \frac{1}{abc (1-z)} \right ]$ \\
& $=$ & $\lim_{z \longrightarrow 1} \frac{abc - a_z b_z c_z}{a_z b_z c_z abc (1-z)}$ \\
& $=$ & $\lim_{z \longrightarrow 1} \frac{abc - a_z b_z c_z}{a^2 b^2 c^2 (1-z)}$ \\
& $\stackrel{(*)}{=}$ & $\lim_{x \longrightarrow 0} \frac{abc - a_{(1-x)} b_{(1-x)} c_{(1-x)}}{a^2 b^2 c^2 x}$ \\
& $\stackrel{LH}{=}$ & $\lim_{x \longrightarrow 0} \frac{-[a_{(1-x)}' b_{(1-x)} c_{(1-x)} + a_{(1-x)} b_{(1-x)}' c_{(1-x)} + a_{(1-x)} b_{(1-x)} c_{(1-x)}'}{a^2 b^2 c^2}$ \\
& $\stackrel{(**)}{=}$ & $\frac{\left ( \frac{(a-1)a}{2}\right ) bc + a \left ( \frac{(b-1) b}{2} \right ) c + ab \left ( \frac{(c-1) c}{2} \right )}{a^2 b^2 c^2}$ \\
& $=$ & $\frac{a + b + c - 3}{2 abc}$
\end{tabular}

\noindent{(*)  This is equal by substituting $x=1-z$, i.e. $z=1-x$.  Note that when $z \longrightarrow 1$, then $x \longrightarrow 0$.}

\noindent{(**)  This is equal since $a_{(1-x)}' \stackrel{(x \longrightarrow 0)}{=} - \frac{(a-1) a}{2}$, similarly for $b_{(1-x)}'$ and $c_{(1-x)}'$.}

\scalebox{0.87}{
\begin{tabular} {r c l}
$\bullet$ $B_1$ & $=$ & $\lim_{z \longrightarrow 1} \left [ \frac{1-z}{(1-z^a)(1-z^b)(1-z^c)} - \frac{a + b + c -3}{2abc (1-z)} - \frac{1}{abc (1-z)^2} \right ]$ \\
& $=$ & $\lim_{z \longrightarrow 1} \left [ \frac{1}{a_z b_z c_z (1-z)^2} - \frac{a + b + c -3}{2abc (1-z)} - \frac{1}{abc (1-z)^2} \right ]$ \\
& $=$ & $ \lim_{z \longrightarrow 1} \frac{2abc - (a + b +c - 3) a_z b_z c_z (1-z) - 2a_z b_z c_z}{2a_z b_z c_z abc (1-z)^2}$ \\
& $=$ & $\lim_{z \longrightarrow 1} \frac{2abc - (a + b +c - 3) a_z b_z c_z (1-z) - 2a_z b_z c_z}{2a^2 b^2 c^2(1-z)^2}$ \\
& $\stackrel{(***)}{=}$ & $ \lim_{x \longrightarrow 0} \frac{2abc + (a + b +c - 3) a_{(1+x)} b_{(1+x)} c_{(1+x)} x - 2a_{(1+x)} b_{(1+x)} c_{(1+x)}}{2a^2 b^2 c^2x^2}$ \\
& $\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 0} \frac{(a+b+c-3) \Big( (a_{(1+x)} b_{(1+x)} c_{(1+x)})' x + a_{(1+x)} b_{(1+x)} c_{(1+x)}\Big)}{4a^2 b^2 c^2 x} $ \\
& & $- \frac{2 (a_{(1+x)} b_{(1+x)} c_{(1+x)})'}{4a^2 b^2 c^2 x}$ \\
& $\stackrel{(LH)}{=}$ & $\frac{1}{2a^2 b^2 c^2} \lim_{x \longrightarrow 0} \frac{(a+b+c-3)[(a_{(1+x)} b_{(1+x)} c_{(1+x)})''x + 2(a_{(1+x)} b_{(1+x)} c_{(1+x)})']}{2} $ \\
& & $- \frac{2(a_{(1+x)} b_{(1+x)} c_{(1+x)})'')}{2}$ \\
\end{tabular}}

\scalebox{0.87}{
\begin{tabular}{r c l}
& $=$ & $\frac{1}{4a^2 b^2 c^2} \lim_{x \longrightarrow 0} (a+b+c-3)[(a_{(1+x)} b_{(1+x)} c_{(1+x)})''x + 2(a_{(1+x)} b_{(1+x)} c_{(1+x)})']$ \\
& & $-2(a_{(1+x)} b_{(1+x)} c_{(1+x)})''$ \\
& $\stackrel{(4*)}{=}$ & $\frac{1}{4a^2 b^2 c^2} \Bigg[ (a+b+c-3) \left [ 0 +2 \left ( \frac{(a-1)a}{2} bc + a \frac{(b-1)b}{2} c + ab \frac{(c-1) c}{2} \right ) \right ]$ \\
& & $- 2 \Big[ \frac{(a-1)a (a+1)}{3} bc + 2 \left ( \frac{(a-1)a}{2} \frac{(b-1)b}{2} c \right ) + 2 \left ( \frac{(a-1)a}{2} b \frac{(c-1)c}{2} \right )$ \\
& & $+ a \frac{(b-1)b(b+1)}{3} c + 2 \left ( a \frac{(b-1)b}{2} \frac{(c-1)c}{2} \right ) + ab \frac{(c-1)c(c+1)}{3} \Big] \Bigg]$ \\
& $=$ & $\frac{1}{4abc} \Bigg[ (a+b+c-3)(a+b+c-3) - \Big[ \frac{2(a-1)(a+1)}{3} + (a-1)(b-1)$ \\
& & $+ (a-1)(c-1) + \frac{2(b-1)(b+1)}{3} + (b-1)(c-1) + \frac{2(c-1)(c+1)}{3} \Big] \Bigg ]$  \\
& $=$ & $\frac{1}{12abc} \Big[ 3(a+b+c-3)^2 - (2(a-1)(a+1) + 3(a-1)(b-1)$ \\
& & $+ 3(a-1)(c-1) + 2(b-1)(b+1) + 3(b-1)(c-1) + 2(c-1)(c+1)) \Big]$ \\
& $=$ & $\frac{1}{12abc} (a^2 + b^2 + c^2 +3ab + 3ac + 3bc -12a -12b -12c + 24)$
\end{tabular}}

\noindent{(***)  This is equal by substituting $x=z-1$, i.e. $z=x+1$.  Note that when $z \longrightarrow 1$, then $x \longrightarrow 0$.}

\noindent{(4*) Note as $x \longrightarrow 0$ $a_{(1+x)}' = \frac{(a-1)a}{2}$ and $a_{(1+x)}'' = \frac{(a-1)a(a+1)}{3}$.}

\begin{tabular} {r c l}
$\bullet$ $C_2^{\omega}$ & $=$ & $\lim_{z \longrightarrow \bar{\omega}} \frac{(1 - \omega z)^2}{(1-z^a)(1-z^b)(1-z^c)}$ \\
& $\stackrel{(5*)}{=}$ & $\lim_{x \longrightarrow 1} \frac{(1-x)^2}{(1-x^a)(1-x^b)(1-x^c)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{(1-x)^2}{(1-x)a_x (1-x) b_x (1-\bar{\omega}^c x^c)}$ \\
& $=$ & $\frac{1}{ab} \lim_{x \longrightarrow 1} \frac{1}{(1-\bar{\omega}^c x^c)} = \frac{1}{ab(1-\bar{\omega}^c)}$
\end{tabular}

\noindent{(5*)  This is equal by letting $x = \omega z$, then $z = \bar{\omega} x$ and when $z \longrightarrow \bar{\omega}$, then $x \longrightarrow 1$.}

\noindent{Similarly, $D_2^{\omega} = \frac{1}{ac(1-\bar{\omega}^b)}$ and $E_2^{\omega} = \frac{1}{bc(1-\bar{\omega}^a)}$.}

\scalebox{0.95}{
\begin{tabular} {r c l}
$\bullet$ $C_1^{\omega}$ & $=$ & $\lim_{z \longrightarrow \bar{\omega}} \left [ \frac{1 - \omega z}{(1-z^a)(1-z^b)(1-z^c)} - \frac{1}{ab(1-\bar{\omega}^c)(1-\omega z)}\right ]$ \\
& $\stackrel{(6*)}{=}$ & $\lim_{x \longrightarrow 1} \left [ \frac{1 - x}{(1-x^a)(1-x^b)(1-\bar{\omega}^c x^c)} - \frac{1}{ab(1-\bar{\omega}^c)(1-x)}\right ]$ \\
& $=$ & $\lim_{x \longrightarrow 1} \left [ \frac{1}{a_x b_x (1-x)(1-\bar{\omega}^c x^c)} - \frac{1}{ab(1-\bar{\omega}^c)(1-x)}\right ]$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{ab(1-\bar{\omega}^c) - a_x b_x (1-\bar{\omega}^c x^c)}{ab a_x b_x (1-x) (1-\bar{\omega}^c x^c)(1-\bar{\omega}^c)}$ \\
& $=$ & $\frac{1}{a^2 b^2 (1-\bar{\omega}^c)} \lim_{x \longrightarrow 1} \frac{ab(1-\bar{\omega}^c) - a_x b_x (1- \bar{\omega}^c x^c)}{(1-x)(1-\bar{\omega}^c x^c)}$ \\
& $=$ & $\frac{1}{a^2 b^2 (1-\bar{\omega}^c)^2} \lim_{x \longrightarrow 1} \frac{ab(1-\bar{\omega}^c) - a_x b_x (1- \bar{\omega}^c x^c)}{(1-x)}$ \\
& $\stackrel{(LH)}{=}$ & $\frac{1}{a^2 b^2 (1-\bar{\omega}^c)^2} \lim_{x \longrightarrow 1} \frac{a_x ' b_x (1-\bar{\omega}^c x^c) + a_x b_x ' (1-\bar{\omega}^c) - a_x b_x c \bar{\omega}^c x^{c-1}}{1}$ \\
& $=$ & $\frac{1}{a^2 b^2 (1-\bar{\omega}^c)^2} \left ( \frac{(a-1)a}{2} b (1-\bar{\omega}^c) + a \frac{(b-1)b}{2} (1-\bar{\omega}^c) - abc \bar{\omega}^c \right )$ \\
& $=$ & $\frac{1}{2 ab (1-\bar{\omega}^c)^2} \left [ (a-1)(1-\bar{\omega}^c) + (b-1)(1-\bar{\omega}^c) - 2c\bar{\omega}^c \right ]$
\end{tabular}}

\noindent{(6*)  This is equal by letting $x = \omega z$, then $z = \bar{\omega} x$ and when $z \longrightarrow \bar{\omega}$, then $x \longrightarrow 1$.}

\noindent{Similarly, $D_1^{\omega} = \frac{1}{2ac(1-\bar{\omega}^b)^2} \left [ (a-1)(1-\bar{\omega}^b) + (c-1)(1-\bar{\omega}^b) - 2b\bar{\omega}^b\right ]$ and} \\
 $E_1^{\omega} = \frac{1}{2bc(1-\bar{\omega}^a)^2} \left [ (b-1)(1-\bar{\omega}^a) + (c-1)(1-\bar{\omega}^a) - 2a\bar{\omega}^a\right ]$.

\begin{tabular}{r c l}
$\bullet$ $F^{\omega}$ & $=$ & $\lim_{z \longrightarrow \bar{\omega}} \frac{1 - \omega z}{(1-z^a)(1-z^b)(1-z^c)}$ \\
& $\stackrel{(7*)}{=}$ & $\lim_{x \longrightarrow 1} \frac{1 - x}{(1-x^a)(1-\bar{\omega}^b x^b)(1-\bar{\omega}^c x^c)}$ \\
& $=$ & $\lim_{x \longrightarrow 1} \frac{1}{a_x (1-\bar{\omega}^b x^b)(1-\bar{\omega}^c x^c)} = \frac{1}{a (1-\bar{\omega}^b)(1-\bar{\omega}^c)}$
\end{tabular}

\noindent{(7*)  This is equal by letting $x = \omega z$, then $z = \bar{\omega} x$ and when $z \longrightarrow \bar{\omega}$ then $x \longrightarrow 1$.}

\noindent{Similarly, $G^{\omega} = \frac{1}{b (1-\bar{\omega}^a)(1-\bar{\omega}^c)}$ and $H^{\omega} = \frac{1}{c (1-\bar{\omega}^a)(1-\bar{\omega}^b)}$.}

\noindent{Further note the following equalities:}

\begin{itemize}
\item  $\frac{1}{1-z} = \sum_{n=0}^{\infty} \binom{n+0}{0} z^n = \sum_{n=0}^{\infty} z^n$
\item  $\frac{1}{(1-z)^2} = \sum_{n=0}^{\infty} \binom{n+1}{1} z^n = \sum_{n=0}^{\infty} (n+1)z^n = \sum_{n=0}^{\infty} (nz^n + z^n)$
\item  $\frac{1}{(1-z)^3} = \sum_{n=0}^{\infty} \binom{n+2}{2} z^n = \frac{1}{2} \sum_{n=0}^{\infty} (n^2 +3n +2)z^n$
\item $\frac{1}{(1-\omega z)} = \sum_{n=0}^{\infty} \binom{n+0}{0} (\omega z)^n = \sum_{n=0}^{\infty} \omega ^n z^n$
\item $\frac{1}{(1-\omega z)^2} = \sum_{n=0}^{\infty} \binom{n+1}{1} (\omega z)^n = \sum_{n=0}^{\infty} (n+1)\omega ^n z^n$
\end{itemize}
Let $\frac{1}{(1-z^a)(1-z^b)(1-z^c)} = \sum_{n=0}^{\infty} f(n) z^n$.  If $f(n) = rn^2 + sn + t$, then 

\begin{tabular}{r c l}
$\bullet$ $r$ & $=$ & $\frac{1}{2} B_3 = \frac{1}{2abc}$
\end{tabular}

\scalebox{0.95}{
\begin{tabular}{r c l}
$\bullet$ $s$ & $=$ & $\frac{3}{2} B_3 + B_2 + \sum_{\substack{w^a=1 \\ w^b=1 \\ w^c \neq 1}} C_{2}^{\omega} \omega ^n + \sum_{\substack{w^a=1 \\ w^c=1 \\ w^b \neq 1}} D_{2}^{\omega} \omega ^n + \sum_{\substack{w^b=1 \\ w^c=1 \\ w^a \neq 1}} E_{2}^{\omega} \omega ^n$ \\
& $=$ & $\frac{3}{2} \left ( \frac{1}{abc} \right ) + \frac{a+b+c-3}{2abc}$ \\
& &  $+ \sum_{\substack{w^C=1 \\ w \neq 1}} \frac{\omega ^n}{ab (1-\bar{\omega}^c)} + \sum_{\substack{w^B=1 \\ w \neq 1}} \frac{\omega ^n}{ac (1-\bar{\omega}^b)} + \sum_{\substack{w^A=1 \\ w \neq 1}} \frac{\omega ^n}{bc (1-\bar{\omega}^a)}$ \\
& $=$ & $ \frac{a+b+c}{2abc} + \frac{1}{ab} \left ( -C \left \{ \frac{s_3 n}{C} \right \} + \frac{C}{2} - \frac{1}{2} \right ) + \frac{1}{ac} \left ( -B \left \{ \frac{s_2 n}{B} \right \} + \frac{B}{2} - \frac{1}{2} \right )$ \\
& & $+ \frac{1}{bc} \left ( -A \left \{ \frac{s_1 n}{A} \right \} + \frac{A}{2} - \frac{1}{2} \right )$ \\
& $=$ & $\frac{Aa + Bb + Cc - 2Aa \left \{ \frac{s_1 n}{A} \right \} - 2Bb \left \{ \frac{s_2 n}{B} \right \} - 2Cc \left \{ \frac{s_3 n}{C} \right \}}{2abc}$
\end{tabular}}

\noindent{where $\gcd (a,b) = C$, $\gcd (a,c) = B$, $\gcd (b,c) = A$ and $s_1 a + s_2 b + s_3 c = 1$.}

\scalebox{0.95}{
\begin{tabular}{r c l}
$\bullet$ $t$ & $=$ & $B_1 + B_2 + 2B_3 + \sum_{\substack{w^a=1 \\ w^b=1 \\ w^c \neq 1}} ( C_2^{\omega} + C_1^{\omega}) \omega ^n + \sum_{\substack{w^a=1 \\ w^c=1 \\ w^b \neq 1}} ( D_2^{\omega} + D_1^{\omega}) \omega ^n$ \\
& & $+ \sum_{\substack{w^b=1 \\ w^c=1 \\ w^a \neq 1}} ( E_2^{\omega} + E_1^{\omega}) \omega ^n + \sum_{\substack{w^a=1 \\ w^b \neq 1 \\ w^c \neq 1}} F_{\omega} \omega ^n + \sum_{\substack{w^b=1 \\ w^a \neq 1 \\ w^c \neq 1}} G_{\omega} \omega ^n + \sum_{\substack{w^c=1 \\ w^a \neq 1 \\ w^b \neq 1}} H_{\omega} \omega ^n$ \\
& $=$ & $\frac{a^2 + b^2 + c^2 + 3ab + 3ac + 3bc -12a -12b -12c + 24}{12abc} + \frac{a+b+c-3}{2abc}$ \\
& & $+ \frac{2}{abc} + \sum_{\substack{w^a=1 \\ w^b=1 \\ w^c \neq 1}} \frac{\omega ^n}{ab(1-\bar{\omega}^c)} + \sum_{\substack{w^a=1 \\ w^c=1 \\ w^b \neq 1}} \frac{\omega ^n}{ac(1-\bar{\omega}^b)} + \sum_{\substack{w^b=1 \\ w^c=1 \\ w^a \neq 1}} \frac{\omega ^n}{bc(1-\bar{\omega}^a)}$ \\
& & $+ \sum_{\substack{w^a=1 \\ w^b=1 \\ w^c \neq 1}} \frac{[(a-1)(1-\bar{\omega}^c) + (b-1)(1-\bar{\omega}^c) - 2c \bar{\omega}^c] \omega^n}{2ab(1-\bar{\omega}^c)^2}$ \\
& & $+ \sum_{\substack{w^a=1 \\ w^c=1 \\ w^b \neq 1}} \frac{[(a-1)(1-\bar{\omega}^b) + (c-1)(1-\bar{\omega}^b) - 2b \bar{\omega}^b] \omega^n}{2ac(1-\bar{\omega}^b)^2}$ \\
& & $+ \sum_{\substack{w^b=1 \\ w^c=1 \\ w^a \neq 1}} \frac{[(b-1)(1-\bar{\omega}^a) + (c-1)(1-\bar{\omega}^a) - 2a \bar{\omega}^a] \omega^n}{2bc(1-\bar{\omega}^a)^2}$ \\
& & $+ \sum_{\substack{w^a=1 \\ w^A \neq 1}} \frac{\omega^n}{a(1-\bar{\omega}^b)(1-\bar{\omega}^c)} + \sum_{\substack{w^b=1 \\ w^B \neq 1}} \frac{\omega^n}{b(1-\bar{\omega}^a)(1-\bar{\omega}^c)}$ \\
& & $+ \sum_{\substack{w^c=1 \\ w^C \neq 1}} \frac{\omega^n}{c(1-\bar{\omega}^a)(1-\bar{\omega}^b)}$
\end{tabular}}

\newpage

\chapter{Geometric Approach}

\section{$d=2$ - Popoviciu}

Lets first consider the numerical monoid, $M$, with two generators $a,b$ which are coprime positive integers, i.e. $M = \mathbb{N} a + \mathbb{N} b$.  Let $f_{M} (n) := $ the number of ways of getting $n$ as a linear combination of $a$'s and $b$'s, with positive integer coefficients.  In other words:

\begin{center} $f_{M} (n) =  \left | \left \{ \begin{bmatrix}
x \\
y 
\end{bmatrix} \subset \mathbb{N}^2 \mid ax+by = n \right \} \right |$. \\  \end{center} 

Geometrically, this is the same questions as asking how many lattice points are on the hypothenuse in Figure \ref{BarPop}. \\

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0) -- (5,0) node [right] {$x$};
\draw [->] (0,-1) -- (0,3) node [above] {$y$};
\draw [-] (0,0) -- (0,2) node[above right] {$\left( 0, \frac{n}{b} \right)$};
\draw [thick] (0,2) -- (4,0) node [above right] {$\left( \frac{n}{a} , 0 \right)$};
\draw [->] (0,2) -- (-1,2.5);
\draw [->] (4,0) -- (5,-.5);
\draw [-] (0,0) -- (4,0);

\end{tikzpicture}
\end{center}
\caption{Line segment from $\left (0,\frac{n}{b} \right )$ to $\left (\frac{n}{a},0 \right )$.}
\label{BarPop}
\end{figure}

Now we would like to transform the hypotenuse in Figure \ref{BarPop} to a horizontal line.  To do this, we need a $2 \times 2$ matrix, $M$, with determinant $1$ and integer entries such that 

\begin{center}
$\begin{bmatrix}
  x \\
  y
\end{bmatrix} = 
M
\begin{bmatrix}
  u \\
  v
\end{bmatrix}$ or 
$\begin{bmatrix}
  u \\
  v
\end{bmatrix} =
M^{-1}
\begin{bmatrix}
  x \\
  y
\end{bmatrix}$
\end{center}
which changes the basis from $x,y$ to $u,v$.  Note that since $a,b$ are coprime, $\exists s,t \in \mathbb{Z}$ such that $as+bt=1$ and if we let 

\begin{center} $ 
M = \begin{bmatrix}
  b & s \\
  -a & t
\end{bmatrix}$
\end{center}
then $M$ has determinant $1$, integer entries and 

\begin{center}
$\begin{bmatrix}
  x \\
  y
\end{bmatrix} = 
\begin{bmatrix}
   b & s \\
  -a & t
\end{bmatrix}
\begin{bmatrix}
  u \\
  v
\end{bmatrix}$ or 
$\begin{bmatrix}
  u \\
  v
\end{bmatrix} =
\begin{bmatrix}
  t & -s \\
  a & b
\end{bmatrix}
\begin{bmatrix}
  x \\
  y
\end{bmatrix}$.
\end{center}
Further note that we have 

\begin{center}
$n = ax + by = \begin{bmatrix}
  a & b
\end{bmatrix}
\begin{bmatrix}
  x \\
  y
\end{bmatrix} =
\begin{bmatrix}
  a & b
\end{bmatrix}
\begin{bmatrix}
  b & s \\
  -a & t
\end{bmatrix}
\begin{bmatrix}
  u \\
  v
\end{bmatrix} =
\begin{bmatrix}
  0 & 1
\end{bmatrix}
\begin{bmatrix}
  u \\
  v
\end{bmatrix} 
= v = n$.
\end{center}
hence the endpoints of the hypotenuse will have the same $v$-coordinate under the new basis and hence will be a horizontal line.  Performing this computation we get

\begin{center}
$M^{-1}
\begin{bmatrix}
   0 \\
   \frac{n}{b}
\end{bmatrix} = 
\begin{bmatrix}
  t & -s \\
  a & b
\end{bmatrix}
\begin{bmatrix}
  0  \\
  \frac{n}{b}
\end{bmatrix} = 
\begin{bmatrix}
  -\frac{sn}{b} \\
  n
\end{bmatrix}$ and 
$M^{-1}
\begin{bmatrix}
   \frac{n}{a} \\
   0
\end{bmatrix} = 
\begin{bmatrix}
  t & -s \\
  a & b
\end{bmatrix}
\begin{bmatrix}
  \frac{n}{a}  \\
  0
\end{bmatrix} = 
\begin{bmatrix}
  \frac{tn}{a} \\
  n
\end{bmatrix}$.
\end{center}

Note, since the determinant is positive, we preserve the orientation, hence we know that $-\frac{sn}{b} < \frac{tn}{a}$.  Thus the hypotenuse in Figure \ref{BarPop} has been transformed into

\begin{figure}[H]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0) -- (5,0) node [right] {$u$};
\draw [->] (0,-1) -- (0,3) node [above] {$v$};
\draw [<-, dotted] (-1,2) -- (1,2) node [above] {$\left ( -\frac{sn}{b}, n \right )$};
\draw [->, dotted] (4,2) -- (6,2) node [above] {$v=n$};
\draw [thick] (1,2) -- (4,2) node [above] {$\left (\frac{tn}{a}, n \right )$};
\draw [circle] (1,2);

\end{tikzpicture}
\end{center}
\caption{Transformed line segment from $\left(  -\frac{sn}{b}, n \right )$ and $\left( \frac{tn}{a}, n \right )$.}
\label{Vert}
\end{figure}

\noindent{Thus we now have}

\begin{center}  $f_{M} (n) = \left \lfloor \frac{tn}{a} \right \rfloor - \left \lceil -\frac{sn}{b} \right \rceil + 1 =  \left \lfloor \frac{tn}{a} \right \rfloor + \left \lfloor \frac{sn}{b} \right \rfloor + 1 = \frac{n}{ab} - \left \{ \frac{tn}{a} \right \} - \left \{ \frac{sn}{b} \right \} + 1, $ \end{center}
which is the {\bf{\underline{Popoviciu Theorem/Formula}}}, which was found in the $1950$'s.

\section{$d=3$}

Consider the numerical monoid $<a,b,c>$, where $a,b,c$ are coprime.  Our question is as follows:  How many ways can we write a given value $n \in \mathbb{Z}$ as a linear combination of $a, b,$ and $c$, such that $n = as_a + bs_b + cs_c$ where $s_a, s_b, s_c \in \mathbb{Z}_{\ge 0}$?  Geometrically, we can reformulate this question to be: Given a value $n \in \mathbb{Z}$, how many integer points are in the triangle, in the $x,y,z$-plane shown in Figure \ref{a,b,c-3d}. \\

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->, thick] (0,0) -- (5,0,0) node [right] {$x$};
\draw [->, thick] (0,0) -- (0,5,0) node [above] {$y$};
\draw [->, thick] (0,0) -- (0,0,5) node [below left] {$z$};
\draw[black, thick][fill=red] (4,0,0) node [below right] {$\frac{n}{a}$} -- (0,3,0) node [above left] {$\frac{n}{b}$} -- (0,0,2) node [below right] {$\frac{n}{c}$};
\draw[black, thick] (4,0,0) -- (0,0,2);
\draw[dashed]  (0,0) -- (4,0,0);
\draw[dashed]  (0,0) -- (0,3,0);
\draw[dashed]  (0,0) -- (0,0,3);
\end{tikzpicture}
\end{center}
\caption{Plane in the first octant we are considering.}
\label{a,b,c-3d}
\end{figure} 

In order to answer this, the first thing we will to do is transform this triangle so that it fits in a $2$-dimensional plane.  To do this we will use the Johnson relations along with a linear combination for the $\gcd(a,b,c)=1$ in each of the cases:
\begin{itemize}
\item  $R_a a = R_b b = R_c c$;
\item  $R_a a = R_b b \not= R_c c$;
\item  $R_a, R_b, R_c$ are distinct.
\end{itemize}

Before we do this, it was mentioned earlier that there may be a choice to be made when constructing the matrix $A$.  Each choice will result in a triangle in a $2$-dimensional plane, but the shape will vary.  With this in mind, we will be choosing the matrix $A$ that sends our triangle in $3$-dimensions, into a right triangle in $2$-dimensions, when possible.  %When is it possible?  Please consider the following:}

\begin{prop}
\label{RightTriReq}
If there is a matrix $A$ defining the Johnson Transformation with two entries in the first two columns are $0$, then the triangle in Figure \ref{a,b,c-3d} will be transformed into a right triangle in $2$ dimensions.

%In order for the triangle in Figure \ref{a,b,c-3d} to be transformed into a right triangle in $2$ dimensions, there must be two entries in $A$, in distinct columns and rows, which are $0$.

\end{prop}

\begin{proof}

Note that in the matrix $A$ above, the entries $s_{ab}$ and $s_{ac}$ can not simultaneously be $0$, as $R_a >0$.  Similarly for $s_{ba}$ and $s_{bc}$.  Also, $s_{ac}$ and $s_{bc}$ can not be simultaneously $0$, otherwise $R_a a = s_{ab} b$ and $s_{ba} a = R_b b$.  Then $R_a = s_{ba}$ and $R_b = s_{ab}$ by the definition of $R_a$ and $R_b$, hence the first two columns are just multiples of each other, contradicting the construction of the matrix $A$.  Thus, the two $0$'s in matrix $A$, have to be in different rows and columns. \\

Up to a permutation of the generators $a,b$ and $c$ the matrix $A$ is:

\begin{center}  $A = \begin{bmatrix}
  -R_a & s_{ba} & t_a \\
  s_{ab} & -R_b & t_b \\
  s_{ac} & s_{bc} & t_c
\end{bmatrix}$.  \end{center}
\noindent{Note }

\begin{center} $n = ax + by +cy = \begin{bmatrix}
a & b & c
\end{bmatrix}
\begin{bmatrix}
x \\
y \\
z
\end{bmatrix} = \begin{bmatrix}
a & b & c
\end{bmatrix}
\begin{bmatrix}
  -R_a & s_{ba} & t_a \\
  s_{ab} & -R_b & t_b \\
  s_{ac} & s_{bc} & t_c
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} =
\begin{bmatrix}
0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} = w$ \end{center}
thus $w = n$ and hence we have that

\begin{center}
$\begin{bmatrix}
  x \\
  y \\
  z
\end{bmatrix}
= A \begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix}
= \begin{bmatrix}
  -R_a & s_{ba} & t_a \\
  s_{ab} & -R_b & t_b \\
  s_{ac} & s_{bc} & t_c
\end{bmatrix}
\begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix}
=\begin{bmatrix}
  - R_au + s_{ba}v + t_a n \\
  s_{ab}u - R_b v + t_b n \\
  s_{ac}u + s_{bc}v - t_c n
\end{bmatrix}$.
\end{center}
Thus we have that 
\begin{itemize}
\item  $x = - R_au + s_{ba}v + t_a n$
\item  $y = s_{ab}u - R_b v + t_b n$
\item  $z = s_{ac}u + s_{bc}v - R_c n$
\end{itemize} 

Next recall that by definition, $R_a$ and $R_b$ can not equal $0$, hence two of the other entries have to be zero.  Since they have to be on distinct rows and columns, that means that two of the equations listed above have a coefficient of zero.  Lets investigate each:
\begin{itemize}
\item  If $s_{ba} = 0$, then $x = - R_au + t_a n$.  Note that one of the edges from Figure \ref{a,b,c-3d} corresponds to $x = 0$, so to determine where that edge goes in out transformation, we will set $x = 0$ and solve for $u$, as follows:
\begin{center}
\begin{tabular}{r c l}
$0$ & $=$ & $- R_au + t_a n$ \\
$R_au$ & $=$ & $t_a n$ \\
$u$ & $=$ & $\frac{t_a n}{R_a}$, since $R_a \not= 0$. 
\end{tabular}
\end{center}
Hence the edge that corresponds to $x=0$ in Figure \ref{a,b,c-3d} is sent to vertical line in our transformation.

We get a similar result when $s_{bc} = 0$.
\item  If $s_{ab} = 0$, then $y = - R_b v + t_b n$.  Similar to previous case, one of the edges from Figure \ref{a,b,c-3d} corresponds to $y = 0$, so to determine where that edge goes in out transformation, we will set $y = 0$ and solve for $v$, as follows:
\begin{center}
\begin{tabular}{r c l}
$0$ & $=$ & $- R_b v + t_b n$ \\
$R_b v$ & $=$ & $t_b n$ \\
$v$ & $=$ & $\frac{t_b n}{R_b}$, since $R_b \not= 0$. 
\end{tabular}
\end{center}
Hence the edge that corresponds to $y=0$ in Figure \ref{a,b,c-3d} is sent to horizontal line in our transformation.

We get a similar result when $s_{ac} = 0$.
\end{itemize}
Thus, with any combination of the entries being $0$ allowed by the hypothesis, we will get one horizontal edge and one vertical edge.  Therefore the triangle in Figure \ref{a,b,c-3d} will be transformed into a right triangle in $2$-dimensions.
\end{proof}

\begin{conj}
When $R_a a, R_b b$ and $R_c c$ are distinct, then using the Johnson Transformation will not result in a right triangle.

%the triangle from Figure \ref{a,b,c-3d} can not be transformed from $3$-dimensions to $2$-dimensions, as a right triangle.
\end{conj}

\begin{proof}
Lemma \ref{Distinct - Entries} proved that in this case, the entries $s_{ab}, s_{ac}, s_{ba}$ and $s_{bc} >0$.  Hence by Proposition \ref{RightTriReq}, the triangle in Figure \ref{a,b,c-3d} will not be transformed into a right triangle.
\end{proof} 

Now lets consider the cases where it is possible to transform the triangle from Figure \ref{a,b,c-3d} into a right triangle.

%Also, we will be utilizing the following proposition:

\subsection{$R_a a = R_b b = R_c c$}

In this case, we can use the fact that $R_a a = R_b b = R_c c$ to create our matrix:

\begin{center}
$A = \begin{bmatrix}
-R_a & 0 & t_a \\
R_b & -R_b & t_b \\
0 & R_c & t_c
\end{bmatrix}$.
\end{center}
Similar to above,

\begin{center}
$\begin{bmatrix}
  x \\
  y \\
  z
\end{bmatrix}
= A \begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix}$
\end{center}

%Note that $A$ has integer entries and $\det(A) = 1$, i.e. $A \in SL_2 (\mathbb{Z})$ and hence 

%\begin{center}  $A^{-1} = 
%\begin{bmatrix}
 %-R_b t_c - R_c t_b & R_c t_a & R_b t_a \\
 %-R_b t_c & -R_a t_c & R_b t_a + R_a t_b \\
 %R_b R_c & R_a R_c & R_a R_b
%\end{bmatrix} =
%\begin{bmatrix}
 %-R_b t_c - R_c t_b & R_c t_a & R_b t_a \\
 %-R_b t_c & -R_a t_c & R_b t_a + R_a t_b \\
 %a & b & c
%\end{bmatrix}$.
%\end{center}

\noindent{and note }

\begin{center} $n = ax + by +cy = \begin{bmatrix}
a & b & c
\end{bmatrix}
\begin{bmatrix}
x \\
y \\
z
\end{bmatrix} = \begin{bmatrix}
a & b & c
\end{bmatrix}
\begin{bmatrix}
-R_a & 0 & t_a \\
R_b & -R_b & t_b \\
0 & R_c & t_c
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} =
\begin{bmatrix}
0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} = w$ \end{center}
hence this triangle has been transformed into the $2$-dimensional space $w = n$.  Now lets plug in the vertices to see where they are mapped: \\
\begin{itemize}
\item
$\begin{bmatrix}
  \frac{n}{a} \\
  0 \\
  0
\end{bmatrix}
= \begin{bmatrix}
-R_a & 0 & t_a \\
R_b & -R_b & t_b \\
0 & R_c & t_c
\end{bmatrix}
\begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix} =
\begin{bmatrix}
  -R_a u + t_a w \\
  R_b u + -R_b v + t_b w \\
  R_c v + t_c w 
\end{bmatrix}.$ \\

\noindent{So we have that}

\begin{center}
\begin{tabular}{r c l c r c l}
$\frac{n}{a}$ & $=$ & $-R_a u + t_a w$ & $\Longrightarrow$ & $u$ & $=$ & $\frac{t_a n - \frac{n}{a}}{R_a} = \frac{t_a an - n}{R_a a}$ \\
$0$ & $=$ & $R_b u - R_b v + t_b w$ & $\Longrightarrow$ & $u - v$ & $=$ & $\frac{t_b n}{R_b}$ \\
$0$ & $=$ & $R_c v + t_c w$ & $\Longrightarrow$ & $v$ & $=$ & $-\frac{t_c n}{R_c}$ \\
$w$ & $=$ & $n$ \\
\end{tabular},
\end{center}

i.e. $\left( \frac{n}{a}, 0, 0 \right) \longmapsto \left( \frac{t_a an - n}{R_a a}, -\frac{t_c n}{R_c}, n \right)$. \\

\item
$\begin{bmatrix}
  0 \\
  \frac{n}{b} \\
  0
\end{bmatrix}
= \begin{bmatrix}
-R_a & 0 & t_a \\
R_b & -R_b & t_b \\
0 & R_c & t_c
\end{bmatrix}
\begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix} =
\begin{bmatrix}
  -R_a u + t_a w \\
  R_b u + -R_b v + t_b w \\
  R_c v + t_c w 
\end{bmatrix}.$ \\

So we have that

\begin{center}
\begin{tabular}{r c l c r c l}
$0$ & $=$ & $-R_a u + t_a w$ & $\Longrightarrow$ & $u$ & $=$ & $\frac{t_a n}{R_a}$ \\
$\frac{n}{b}$ & $=$ & $R_b u - R_b v + t_b w$ & $\Longrightarrow$ & $u - v$ & $=$ & $\frac{\frac{n}{b} - t_b n}{R_b} = \frac{n - t_b bn}{R_b b}$ \\
$0$ & $=$ & $R_c v + t_c w$ & $\Longrightarrow$ & $v$ & $=$ & $-\frac{t_c n}{R_c}$ \\
$w$ & $=$ & $n$ 
\end{tabular},
\end{center}

i.e. $\left( 0, \frac{n}{b}, 0 \right) \longmapsto \left( \frac{t_a n}{R_a}, -\frac{t_c n}{R_c}, n \right)$. \\

\item
$\begin{bmatrix}
  0 \\
  0 \\
  \frac{n}{c}
\end{bmatrix}
= \begin{bmatrix}
-R_a & 0 & t_a \\
R_b & -R_b & t_b \\
0 & R_c & t_c
\end{bmatrix}
\begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix} =
\begin{bmatrix}
  -R_a u + t_a w \\
  R_b u + -R_b v + t_b w \\
  R_c v + t_c w 
\end{bmatrix}.$ \\

So we have that

\begin{center}
\begin{tabular}{r c l c r c l}
$0$ & $=$ & $-R_a u + t_a w$ & $\Longrightarrow$ & $u$ & $=$ & $\frac{t_a n}{R_a}$ \\
$0$ & $=$ & $R_b u - R_b v + t_b w$ & $\Longrightarrow$ & $u - v$ & $=$ & $\frac{t_b n}{R_b}$ \\
$\frac{n}{c}$ & $=$ & $R_c v + t_c w$ & $\Longrightarrow$ & $v$ & $=$ & $\frac{\frac{n}{c} - t_c n}{R_c} = \frac{n - t_c cn}{R_c c}$ \\
$w$ & $=$ & $n$ 
\end{tabular},
\end{center}

i.e. $\left( 0, 0, \frac{n}{c} \right) \longmapsto \left( \frac{t_a n}{R_a}, \frac{n - t_c cn}{R_c c}, n \right)$. \\
\end{itemize}

Note that two of the three points lie on the same vertical line and have a distance of $\frac{n}{c}$ between them.  Meanwhile, two of the three points lie on the same horizontal line and have a distance of $\frac{n}{a}$ between them.  So we have the expected right triangle in $2$-space.  Further, note that the slope is

\begin{center}
\begin{tabular}{r c l}
Slope & $=$ & $ \frac{\frac{\frac{n}{c} - t_c n}{R_c} - \left( -\frac{t_c n}{R_c} \right)}{\frac{t_a n}{R_a} - \left( \frac{t_a n - \frac{n}{a}}{R_a} \right)}$ \\
& $=$ & $\frac{\frac{\frac{n}{c}}{R_c}}{\frac{\frac{n}{a}}{R_a}} = \frac{\frac{n}{c} R_a}{R_c \frac{n}{a}}$ \\
& $=$ & $\frac{n R_a a}{n R_c c} = 1$,
\end{tabular}
\end{center}
since $R_a a = R_c c$.  Note that the sides of this triangle may or may not be lattical.  This will be completely dependent on the endpoints of the hypotenuse.  If they are lattice points, then all three sides are latticial.  Thus, after some reflections, shifts of integer distance and shading the margins, we have Figure \ref{Isos2D}.

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0.5) -- (6,0.5) node [right] {$u$};
\draw [->] (0.5,-1) -- (0.5,6) node [above] {$v$};
\draw[thick] (0,0) -- (5,0);
\draw[thick] (0,0) -- (0,5);
\draw (0,2.5) node [left] {$\frac{n}{R_a a} = \frac{n}{R_a R_b R_c}$};
\draw (2.5, 0) node [below] {$\frac{n}{R_c c} = \frac{n}{R_a R_b R_c}$};
\draw[thick] (0,5) -- (5,0);
\draw[thick] (0,4) -- (4,0);
\draw (2.5, 2.5) node [above right] {Slope $= -1$};
\draw[black][fill=gray] (0,0) -- (5,0) -- (4.5,0.5) -- (0.5,0.5) -- (0.5,4.5) -- (0,5);
\draw[fill=gray] (4,0) -- (5,0) -- (0,5) -- (0,4);
\draw[dashed] (0,0.5) -- (0.5, 0.5);
\draw[dashed] (0.5, 0.5) -- (0.5, 0);
\draw[dashed] (0.5,3) -- (0.5,5);
\draw[dashed] (3,0.5) -- (5,0.5);
\draw (0.5,3) node [below right] {$d$};
\draw[dashed] (3.5,0) -- (3.5,0.8) node[right] {$T_2$} -- (3.5,1.5);
\draw[dashed] (4.5,0) node[below right] {$T_1$}-- (4.5,0.5);
\end{tikzpicture}
\end{center}
\caption{Isosceles Triangle after transformation from $3$ to $2$ dimensional space and integral translations}
\label{Isos2D}
\end{figure}

If margins are present, then note that there will not be any lattice points in the margins of our triangle, thus when counting the lattice points, we will focus on the non-shaded area of the triangle in Figure \ref{Isos2D}.  Further note that since $R_a a = R_c c$ then this triangle is an isosceles right triangle.  This combined with the fact the the hypotenuse has slope $=-1$ means that both the vertices on the hypotenuse and hence all vertices of the non-shaded triangle, are lattice points.  We can now simply use Pick's Theorem to count the number of lattice points in our triangle.  If the height of this isosceles right triangle is $d$, as indicated in Figure \ref{Isos2D}, then we have that

\begin{center}  $f(n) = \frac{d^2}{2} + 3 \frac{d}{2} + 1 = {d+2 \choose 2}$.  \end{center}
However, what is $d$ in this case?  To find that out, notice that $T_1$ and $T_2$ in Figure \ref{Isos2D} are also isosceles right triangles.  Further note that the latticial measure of the margin on the horizontal side of our triangle is $\left\{ \frac{n}{\text{gcd} (a,b)} \right\} = \left \{ \frac{n}{R_c} \right \}$ and the latticial measure of the margin on the vertical side of our triangle is $ \left \{ \frac{n}{\text{gcd} (a,c)} \right \} = \left \{  \frac{n}{R_b} \right \}$.  Thus the latticial measure of legs of $T_1 = \left \{ \frac{n}{R_c} \right \}$ and the latticial measure of the legs of $T_2 = \left \{ \frac{n}{R_a} \right \}$.  Thus,

\begin{center}  the (latticial) length of $d = \frac{n}{R_a R_b R_c} - \left \{ \frac{n}{R_a} \right \} - \left \{ \frac{n}{R_b} \right \} - \left \{ \frac{n}{R_c} \right \}$.  \end{center}
So now we can write out $f(n)$:

\begin{center}
\scalebox{0.95}{
\begin{tabular}{r c l}
$f(n)$ & $=$ & $\frac{1}{2} \left( \frac{n}{R_a R_b R_c} - \left \{ \frac{n}{R_a} \right \} - \left \{ \frac{n}{R_b} \right \} - \left \{ \frac{n}{R_c} \right \} + 2 \right)$ \\
& & $\times \left( \frac{n}{R_a R_b R_c} - \left \{ \frac{n}{R_a} \right \} - \left \{ \frac{n}{R_b} \right \} - \left \{ \frac{n}{R_c} \right \} + 1 \right)$ \\
& $=$ & $\frac{n^2}{2R_a^2 R_b^2 R_c^2} - \frac{n}{R_a R_b R_c} \left( \left\{  \frac{n}{R_a} \right\} + \left\{  \frac{n}{R_b} \right\} + \left\{  \frac{n}{R_c} \right\} \right) + \frac{n}{2R_a R_b R_c}$ \\
& & $+ \frac{1}{2} \left\{  \frac{n}{R_a} \right\}^2 + \frac{1}{2} \left\{  \frac{n}{R_b} \right\}^2 + \frac{1}{2} \left\{  \frac{n}{R_c} \right\}^2 + \left\{  \frac{n}{R_a} \right\}\left\{  \frac{n}{R_b} \right\} + \left\{  \frac{n}{R_a} \right\}\left\{  \frac{n}{R_c} \right\}$ \\
& & $+ \left\{  \frac{n}{R_b} \right\}\left\{  \frac{n}{R_c} \right\} - \frac{1}{2} \left\{  \frac{n}{R_a} \right\} - \frac{1}{2} \left\{  \frac{n}{R_b} \right\} - \frac{1}{2} \left\{  \frac{n}{R_c} \right\} + \frac{n}{R_a R_b R_c}$ \\
& & $- \left\{  \frac{n}{R_a} \right\} - \left\{  \frac{n}{R_b} \right\} - \left\{  \frac{n}{R_c} \right\} + 1$
\end{tabular}}
\end{center}

\begin{center}
\scalebox{0.95}{
\begin{tabular}{r c l}
& $=$ & $\frac{n^2}{2abc} - \frac{n}{R_a R_b R_c} \left( \left\{  \frac{n}{R_a} \right\} + \left\{  \frac{n}{R_b} \right\} + \left\{  \frac{n}{R_c} \right\} - \frac{3}{2} \right) + \frac{1}{2} \left\{  \frac{n}{R_a} \right\}^2 + \frac{1}{2} \left\{  \frac{n}{R_b} \right\}^2$ \\
& & $+ \frac{1}{2} \left\{  \frac{n}{R_c} \right\}^2 + \left\{  \frac{n}{R_a} \right\}\left\{  \frac{n}{R_b} \right\} + \left\{  \frac{n}{R_a} \right\}\left\{  \frac{n}{R_c} \right\} + \left\{  \frac{n}{R_b} \right\}\left\{  \frac{n}{R_c} \right\} - \frac{3}{2} \left\{  \frac{n}{R_a} \right\}$ \\
& & $- \frac{3}{2} \left\{  \frac{n}{R_b} \right\} - \frac{3}{2} \left\{  \frac{n}{R_c} \right\} + 1$ \\
\end{tabular}}
\end{center}





\subsection{$R_a a = R_b b \not= R_c c$}

\subsubsection{McNugget Problem - $R_6 6 = 18 = R_9 9 \not= R_{20} 20 = 60$}

Consider the numerical monoid $<6,9,20>$.  %Our question is as follows:  How many ways can we write a given value $n \in \mathbb{Z}$ as a linear combination of $6, 9,$ and $20$, such that $n = 6a_1 + 9a_2 + 20a_3$ where $a_1, a_2, a_3 \in \mathbb{Z}_{\ge 0}$.  Geometrically, we can reformulate this question to be: Given a value $n \in \mathbb{Z}$, 
So our question for this example is, how many integer points are in the triangle, in the $x,y,z$-plane shown in Figure \ref{6,9,20-3d}.

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (0,0) -- (5,0,0) node [right] {$x$};
\draw [->] (0,0) -- (0,3.5,0) node [above] {$y$};
\draw [->] (0,0) -- (0,0,3.5) node [below left] {$z$};
\draw[black, thick][fill=yellow] (4,0,0) node [below right] {$\frac{n}{6}$} -- (0,3,0) node [above left] {$\frac{n}{9}$} -- (0,0,2) node [below right] {$\frac{n}{20}$};
\draw[black, thick] (0,0,2) -- (4,0,0);
\draw[dashed]  (0,0) -- (4,0,0);
\draw[dashed]  (0,0) -- (0,3,0);
\draw[dashed]  (0,0) -- (0,0,3);
\end{tikzpicture}
\end{center}
\caption{Plane in the first octant we are considering.}
\label{6,9,20-3d}
\end{figure} 

First thing we need to do is transform this triangle so that it fits in a $2$-dimensional plane.  To do this we will use the Johnson relations along with a linear combination for the $\gcd(6,9,20)=1$.  Note the following:

\begin{center}
\begin{itemize}
\item  $R_6 = 3$ as $6 \times 3 = 9 \times 2 = 18 \in <9,20>$,
\item  $R_9 = 2$ as $9 \times 2 = 6 \times 3 = 18 \in <6,20>$,
\item  $R_{20} = 3$ as $20 \times 3 = 6 \times 10 = 60 \in <6,9>$,
\item  $6(2) + 9(1) + 20(-1) = 1$.
\end{itemize}
\end{center}
Using these items, we will create our matrix:

\begin{center}
$A = \begin{bmatrix}
10 & -3 & 2 \\
0 & 2 & 1 \\
-3 & 0 & -1
\end{bmatrix}$,
\end{center}
such that

\begin{center} 
$\begin{bmatrix}
  x \\
  y \\
  z
\end{bmatrix}
= A \begin{bmatrix}
 u \\
 v \\
 w
\end{bmatrix}$ \end{center}
Note that $A$ has integer entries and $\det(A) = 1$, i.e. $A \in SL_2 (\mathbb{Z})$ and hence 

\begin{center}  $A^{-1} = 
\begin{bmatrix}
 -2 & -3 & -7 \\
 -3 & -4 & -10 \\
 6 & 9 & 20
\end{bmatrix}$.  \end{center}
Further note that 

\begin{center} $n = 6x + 9y +20y = \begin{bmatrix}
6 & 9 & 20
\end{bmatrix}
\begin{bmatrix}
x \\
y \\
z
\end{bmatrix} = \begin{bmatrix}
6 & 9 & 20
\end{bmatrix}
\begin{bmatrix}
10 & -3 & 2 \\
0 & 2 & 1 \\
-3 & 0 & -1
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} =
\begin{bmatrix}
0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} = w$ \end{center}
hence the vertices of the triangle will have the same $w$-coordinate under the new basis and hence will all lay on the plane $w=n$, i.e. this triangle has been transformed into a $2$-dimensional space.  Performing the transformation on the vertices we get the following in our new basis $u, v, w$:

\begin{center}  $A^{-1} \
\begin{bmatrix}
  \frac{n}{6} \\
  0 \\
  0
\end{bmatrix} = 
\begin{bmatrix}
 -\frac{n}{3} \\
 -\frac{n}{2} \\
 n
\end{bmatrix}$, $A^{-1} \
\begin{bmatrix}
  0 \\
  \frac{n}{9} \\
  0
\end{bmatrix} = 
\begin{bmatrix}
 -\frac{n}{3} \\
 -\frac{4n}{9} \\
 n
\end{bmatrix}$ and $A^{-1} \
\begin{bmatrix}
  0 \\
  0 \\
  \frac{n}{20}
\end{bmatrix} = 
\begin{bmatrix}
 -\frac{7n}{20} \\
 -\frac{n}{2} \\
 n
\end{bmatrix}$. \end{center} 

Note that the first two points lie on the same vertical line and have a distance of $\frac{n}{18}$ between them.  Meanwhile, the first and third point lie on the same horizontal line and have a distance of $\frac{n}{60}$ between them.  Thus we have a right triangle in $2$-dimensions.  With some elementary reflections and translations by integral distances, we have Figure \ref{McN2D}.

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0.3) -- (10,0.3) node [right] {$u$};
\draw [->] (0.5,-1) -- (0.5,4) node [above] {$v$};
\draw[thick] (9,0) -- (4.5,0) node [below] {$\frac{n}{18}$};
\draw[thick] (4.5,0) -- (0,0) node [below left] {$\left( - \left \{ \frac{n}{2} \right \}, - \left \{ \frac{2n}{3} \right \} \right)$};
\draw[thick] (0,0) -- (0,1.5) node [left] {$\frac{n}{60}$};
\draw[thick] (0,1.5) -- (0,3);
\draw[thick] (0,3) -- (4.5,1.5) node [above] {Slope $= -\frac{3}{10}$};
\draw[thick] (4.5,1.5) -- (9,0);
\draw[black][fill=gray] (0,0) -- (9,0) -- (8.1,0.3) -- (0.5,0.3) -- (0.5,2.8333333) -- (0,3) -- (0,0);
\draw[dashed] (0,0.3) -- (0.5, 0.3);
\draw[dashed] (0.5, 0.3) -- (0.5, 0);
\end{tikzpicture}
\end{center}
\caption{Triangle after transformation from $3$ to $2$ dimensional space and integral translations}
\label{McN2D}
\end{figure}

Notice that $0 \le \left \{ \frac{n}{2} \right \} <1, 0 \le \left \{ \frac{2n}{3} \right \} <1$.  Therefore, there will never be a lattice point in the shaded area of Figure \ref{McN2D}, hence we can just focus on the non-shaded area of the triangle, which we will now refer to as $P$, to find our lattice points.  So the first thing we need to do is identify the location of the vertices of $P$, denoted at $R$ and $S$, aside from the obvious vertex, which is at the origin, $O = (0,0)$.  In order to do this, we also need to vertices of the larger triangle (which includes the shaded area), which will be denoted as $P'$, aside from the obvious vertex, which is $\left( - \left \{ \frac{n}{2} \right \}, - \left \{ \frac{2n}{3} \right \} \right)$.  Lets denote these vertices of $P'$ as $R'$ and $S'$.  Since the lengths of the vertical side and the horizontal side of $P'$ are known, $\frac{n}{60}$ and $\frac{n}{18}$ respectively, then we can determine that $R' = \left( - \left \{ \frac{n}{2} \right \}, \frac{n}{60} - \left \{ \frac{2n}{3} \right \} \right)$ and $S' = \left( \frac{n}{18} - \left \{ \frac{n}{2} \right \}, - \left \{ \frac{2n}{3} \right \} \right)$.  Thus we can calculate the vertices of $P$, $R = \left( 0, \frac{n}{60} - \left \{ \frac{2n}{3} \right \} - \frac{3}{10} \left \{ \frac{n}{2} \right \} \right)$ and $S = \left( \frac{n}{18} - \left \{ \frac{n}{2} \right \} - \frac{10}{3} \left \{ \frac{2n}{3} \right \}, 0 \right)$.

We will now proceed using the theorem of Brion.  Therefore, we will be breaking our triangle from Figure \ref{McN2D} into the following cones: \\

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}[scale=0.8]
\draw (2,5) node {$K_O$}; 
%\fill [gray] (0,0) -- (0,4) -- (4,4) -- (4,0);

\shade[left color=gray, right color=white, shading angle=135]
    (0,0) -- (40mm,0mm) arc (0:90:40mm) -- cycle;
\draw[thick, ->] (0,0)  -- (4,0);
\draw[thick, ->] (0,0) node [below left] {$O$} -- (0,4);

\draw[thick, ->] (4.5,0) -- (9.5,0);
\draw[thick, ->] (4.5,0) -- (4.5,4);
%\fill [gray] (5,-0.5) -- (5,2) -- (10,-0.5);
\shade[left color=gray, right color=white, shading angle=45]
    (4.5,2) -- (95mm,-5mm) arc (0:-132:30mm) -- cycle;

\draw[thick, ->] (4.5,2) node [left] {$R$} -- (4.5,-2.75);
\draw[thick, ->] (4.5,2) -- (9.5,-0.5);
\draw (7,2) node {$K_R$};

\draw[, ->] (11.5,0) -- (15.75,0) node [below left] {$S$};
\draw[thick, ->] (11.5,0) -- (11.5,4);
%\fill [gray] (15,0) -- (10.5, 2.25) -- (10.5,0);
\shade[left color=white, right color=gray, shading angle=70]
    (15.5,0) -- (105mm,25mm) arc (135:222.5:18mm) -- cycle;
    
\draw[thick, ->] (15.5,0) -- (10.5, 2.5);
\draw[thick, ->] (15.5,0) -- (10.5, 0);
\draw (14,2) node {$K_S$};
\end{tikzpicture}
\end{center}
\caption{Cones used for McNugget Problem}
\label{McNCones}
\end{figure}

\noindent{However, before we fully use Brion, we need to investigate the fundamental parallelograms for each of the cones in Figure \ref{McNCones}.  Note that the fundamental parallelograms will be created by vectors, of latticial length $1$, which are generating vectors of the cone, and will be used to tile the entire cone.  For $K_O$, the latticial length will be the same as the Euclidean length so the fundamental parallelogram, which we will denote as $FP_{O}$, will actually be a half open unit square, as in Figure \ref{FPCO}.}

 \begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw[thick] (-4,0) node [below] {$O$} -- (-4,1);
\draw[thick] (-4,0) -- (-3,0);
\draw[dashed] (-4,1) -- (-3,1);
\draw[dashed] (-3,0) -- (-3,1);
\draw (-3.5,1.5) node {$FP_{O}$}; 

\draw[thick,->] (-2.5, 1) arc (140:110:3);

\shade[left color=cyan, right color=white, shading angle=135]
    (0,0) -- (50mm,0mm) arc (0:90:50mm) -- cycle;
%\shade[left color=blue, right color=white, shading angle=135] (0,0) rectangle +(5,5);
%\fill [blue] (0,0) -- (0,4) -- (4,4) -- (4,0);
\draw[thick] (0,0)  -- (0,1) node [left] {$(0,1)$};
\draw[thick] (0,0) -- (1,0) node [below] {$(1,0)$};
\draw (0,0) node [below left] {$(0,0)$};
\draw[white, thick] (0,1) -- (5,1);
\draw[white, thick] (0,2) -- (5,2);
\draw[white, thick] (0,3) -- (5,3);
\draw[white, thick] (0,4) -- (5,4);
\draw[white, thick] (1,0) -- (1,5);
\draw[white, thick] (2,0) -- (2,5);
\draw[white, thick] (3,0) -- (3,5);
\draw[white, thick] (4,0) -- (4,5);
\draw[thick, ->] (0,1) -- (0,5);
\draw[thick, ->] (1,0)  -- (5,0);

\end{tikzpicture}
\end{center}
\caption{Fundamental Parallelogram of $C_O$}
\label{FPCO}
\end{figure}

 \begin{figure}[h]. %Copied this here because everything was out of whack when left below
\begin{center}
\begin{tikzpicture}
\draw[thick] (-7,2) node [above] {$R$}-- (-5,1) node [right] {$\begin{bmatrix} 10 & -3 \end{bmatrix} $};
\draw[thick] (-7,2) -- (-7,1);
\draw[dashed] (-7,1) -- (-5,0);
\draw[dashed] (-5,1) -- (-5,0);
\draw (-6.5,3.5) node {$FP_{R}$}; 

\draw[thick,->] (-2.5, 1) arc (140:110:3);

\draw[thick,->] (0,0)  -- (0,5);
\draw[thick,->] (0,0) -- (5,0);

\shade[left color=red, right color=white, shading angle=45]
    (0,2) -- (50mm,-5mm) arc (0:-132:30mm) -- cycle;

%\fill [red] (0,2) -- (5,-0.5) -- (0,-0.5);
\draw[thick,->] (0,2) -- (5,-0.5);
\draw[thick,->] (0,2) -- (0,-2.75);
\draw[white, thick] (0,1.5) -- (5,-1);
\draw[white, thick] (0,1) -- (5,-1.5);
\draw[white, thick] (0,0.5) -- (5,-2);
\draw[white, thick] (0,0) -- (5,-2.5);
\draw[white, thick] (0,-0.5) -- (4.5,-2.75);
\draw[white, thick] (0,-1) -- (4,-3);
\draw[white, thick] (0,-1.5) -- (3.5,-3.25);
\draw[white, thick] (0,-2) -- (3,-3.5);
\draw[white, thick] (0,-2.5) -- (2.5,-3.75);
\draw[white, thick] (1,1.5) -- (1,-3.5);
\draw[white, thick] (2,1) -- (2,-3.75);
\draw[white, thick] (3,0.5) -- (3,-3.5);
\draw[white, thick] (4,0) -- (4,-3);
\end{tikzpicture}
\end{center}
\caption{Fundamental Parallelogram of $C_R$}
\label{FPCR}
\end{figure}

 \begin{figure}[h]. %Copied this here because everything was out of whack when left below
\begin{center}
\begin{tikzpicture}
\draw[thick] (-5,2) node [above right] {$S + \begin{bmatrix} -10 & 3 \end{bmatrix} $} -- (-3,1) node [right] {$S$};
\draw[thick] (-3,1) -- (-4,1);
\draw[dashed] (-5,2) -- (-6,2);
\draw[dashed] (-4,1) -- (-6,2);
\draw (-4.5,4) node {$FP_{S}$}; 

\draw[thick,->] (-2.5, 1) arc (140:110:3);

\draw[thick,->] (1,0)  -- (1,5);
\draw[thick,->] (1,0) -- (6,0);

\shade[left color=white, right color=green, shading angle=70]
    (5,0) -- (0mm,25mm) arc (135:222.5:18mm) -- cycle;

%\fill [green] (4,0) -- (-1,2.5) -- (-1,0);
\draw[thick,->] (5,0) -- (0,2.5);
\draw[thick,->] (5,0) -- (0,0);
\draw[white, thick] (4,0) -- (-0.5,2.25);
\draw[white, thick] (3,0) -- (-0.5,1.75);
\draw[white, thick] (2,0) -- (-1,1.5);
\draw[white, thick] (1,0) -- (-1,1);
\draw[white, thick] (4,0.5) -- (-0.5,0.5);
\draw[white, thick] (3,1) -- (-0.75,1);
\draw[white, thick] (2,1.5) -- (-0.75,1.5);
\draw[white, thick] (1,2) -- (-0.5,2);
\end{tikzpicture}
\end{center}
\caption{Fundamental Parallelogram of $C_S$}
\label{FPCS}
\end{figure}

\noindent{Therefore, we can represent all the lattice points in $K_O$ using a Hilbert Series, written as a rational expression.  However, the ability to tile this cone with $FP_{O}$ makes this easier, as the numerator of this rational expression will correspond to the lattice points in $FP_{O}$, which, in this case, is just the origin $O$.  Further, the factors of the denominator correspond to the basis vectors of $K_O$.  So the Hilbert Series representing the lattice points in $K_O$ is:}

\begin{center}  $\frac{1}{(1-x)(1-y)}$, since $x^0 y^0 = 1$. \end{center}
Similarly, the $FP_{R}$, the latticial length of the vertical side will be the usual Euclidean length, however the side corresponding to the hypothenuse of $P$, will not.  The vector creating that side of $FP_{R}$ will the vector $\begin{bmatrix}
10 & -3 
\end{bmatrix}$ translated up to $R$, as in Figure \ref{FPCR}. \\

%\begin{figure}[h]
%\begin{center}
%\begin{tikzpicture}
%\draw[thick] (-7,2) node [above] {$R$}-- (-5,1) node [right] {$R + \overrightarrow{(3,-10)}$};
%\draw[thick] (-7,2) -- (-7,1);
%\draw[dashed] (-7,1) -- (-5,0);
%\draw[dashed] (-5,1) -- (-5,0);
%\draw (-6.5,3.5) node {$FP_{C_R}$}; 

%\draw[thick,->] (-2.5, 1) arc (140:110:3);

%\draw[thick,->] (0,0)  -- (0,5);
%\draw[thick,->] (0,0) -- (5,0);
%\fill [red] (0,2) -- (5,-0.5) -- (0,-0.5);
%\draw[thick,->] (0,2) -- (5,-0.5);
%\draw[thick,->] (0,2) -- (0,-0.5);
%\draw[white, thick] (0,1.5) -- (4,-0.5);
%\draw[white, thick] (0,1) -- (3,-0.5);
%\draw[white, thick] (0,0.5) -- (2,-0.5);
%\draw[white, thick] (0,0) -- (1,-0.5);
%\draw[white, thick] (1,1.5) -- (1,-0.5);
%\draw[white, thick] (2,1) -- (2,-0.5);
%\draw[white, thick] (3,0.5) -- (3,-0.5);
%\draw[white, thick] (4,0) -- (4,-0.5);
%\end{tikzpicture}
%\end{center}
%\caption{Fundamental Parallelogram of $C_R$}
%\label{FPCR}
%\end{figure}

Note that in $FP_{R}$ we have $10$ lattice point, therefore the numerator of our Hilbert Series, written as a rational expression, will have $10$ terms (what those $10$ terms are will depend on $n$).  Lets denote these $10$ terms as the polynomial $P_R (x)$.  So the Hilbert Series, written as a rational expression will have the following form:

\begin{center}  $\frac{P_R (x)}{(1-y^{-1})(1-x^{10} y^{-3})}$. \end{center}
However, note that the $y$ coordinates of the lattice points in $FP_{R}$ are either $\lfloor y(R) \rfloor, \lfloor y(R) \rfloor -1, \lfloor y(R) \rfloor - 2$ or $\lfloor y(R) \rfloor -3$, where $y(R)$ denotes the $y$-coordinate of $R$.

Finally, the $FP_{S}$, the latticial length of the horizontal side will be the usual Euclidean length, however the side corresponding to the hypothenuse of $P$, will not.  The vector creating that side of $FP_{S}$ will the vector $\begin{bmatrix}
-10 & 3 
\end{bmatrix}$ translated over to $S$, as in Figure \ref{FPCS}. \\

%\begin{figure}[h]
%\begin{center}
%\begin{tikzpicture}
%\draw[thick] (-5,2) node [above right] {$S + \overrightarrow{(-3,10)}$} -- (-3,1) node [right] {$S$};
%\draw[thick] (-3,1) -- (-4,1);
%\draw[dashed] (-5,2) -- (-6,2);
%\draw[dashed] (-4,1) -- (-6,2);
%\draw (-4.5,3) node {$FP_{C_S}$}; 

%\draw[thick,->] (-2.5, 1) arc (140:110:3);

%\draw[thick,->] (0,0)  -- (0,5);
%\draw[thick,->] (0,0) -- (5,0);
%\fill [green] (4,0) -- (-1,2.5) -- (-1,0);
%\draw[thick,->] (4,0) -- (-1,2.5);
%\draw[thick,->] (4,0) -- (-1,0);
%\draw[white, thick] (3,0) -- (-1,2);
%\draw[white, thick] (2,0) -- (-1,1.5);
%\draw[white, thick] (1,0) -- (-1,1);
%\draw[white, thick] (0,0) -- (-1,0.5);
%\draw[white, thick] (3,0.5) -- (-1,0.5);
%\draw[white, thick] (2,1) -- (-1,1);
%\draw[white, thick] (1,1.5) -- (-1,1.5);
%\draw[white, thick] (0,2) -- (-1,2);
%\end{tikzpicture}
%\end{center}
%\caption{Fundamental Parallelogram of $C_S$}
%\label{FPCS}
%\end{figure}

Finally, note that in $FP_{S}$ we have $3$ lattice points, therefore the numerator of our Hilbert Series, written as a rational expression, will have $3$ terms (what those $3$ terms are will depend on $n$).  Lets denote these $3$ terms as the polynomial $P_S (x) = x^a + x^b y + x^c y^2$, where $a,b,c \in \mathbb{Z}_{\ge 0}$ and are distinct.  So the generating Hilbert Series, written as a rational expression will have the following form:

\begin{center}  $\frac{P_S (x)}{(1-x^{-1})(1-x^{-10} y^3)} = \frac{x^a + x^b y + x^c y^2}{(1-x^{-1})(1-x^{-10} y^3)}$. \end{center}
Now consider the sum of these three rational expressions:


\begin{center}  $\frac{1}{(1-x)(1-y)} + \frac{P_R (x)}{(1-y^{-1})(1-x^{10} y^{-3})} + \frac{P_S (x)}{(1-x^{-1})(1-x^{-10} y^{3})}$. \end{center}
Now trying to write these with the same denominator, we get

\begin{center}
\begin{tabular} {r l}
& $\frac{1}{(1-x)(1-y)} + \frac{P_R (x)}{(1-y^{-1})(1-x^{10} y^{-3})} + \frac{P_S (x)}{(1-x^{-1})(1-x^{-10} y^3)}$ \\
$=$ & $\frac{(1-x^{10} y^{-3})}{(1-x)(1-y)(1-x^{10} y^{-3})} + \frac{y(P_R (x))}{(y-1)(1-x^{10} y^{-3})} + \frac{(x)(x^{10} y^{-3})(P_S (x))}{(x-1)(x^{10} y^{-3} - 1)}$ \\
$ =$ & $\frac{(1-x^{10} y^{-3})}{(1-x)(1-y)(1-x^{10} y^{-3})} - \frac{y(1 - x)(P_R (x))}{(1 - x)(1 - y)(1-x^{10} y^{-3})}$ \\
& $+ \frac{(1 - y)(x^{11} y^{-3})(P_S (x))}{(1 - x)(1-y)(1 - x^{10} y^{-3})}$.
\end{tabular}
\end{center}
Now we need to look at $y(1 - x)(P_R (x))$ and $(1 - y)(x^{11} y^{-3})(P_S (x))$ a little closer. \\

\noindent{{\underline{$\mathbf{(1 - y)(x^{11} y^{-3})(P_S (x))}$}}}

Recall that $P_S (x) = x^a + x^b y + x^c y^2$, thus

\begin{center}  $(x^{11} y^{-3})(P_S (x)) = x^{a'} y^{-3} + x^{b'} y^{-2} + x^{c'} y^{-1}$,  \end{center}
where $a' = a + 11, b' = b + 11$ and $c' = c + 11$.  So we can leave this product as 

\begin{center}  $(1 - y)(x^{11} y^{-3})(P_S (x)) = (1-y)(x^{a'} y^{-3} + x^{b'} y^{-2} + x^{c'} y^{-1})$.  \end{center}

\noindent{{\underline{$\mathbf{y(1 - x)(P_R (x))}$}}}

Note that since the $y$ coordinates of the lattice points in $FP_{R}$ are either $\lfloor y(R) \rfloor, \lfloor y(R) \rfloor -1, \lfloor y(R) \rfloor - 2$ or $\lfloor y(R) \rfloor -3$ and there are $10$ lattice points in $FP_{R}$, then we have $2$ cases to consider:  ${\underline{\mathbf{(1)}}}$ the points will have $3$ distinct $y$ coordinates values or ${\underline{\mathbf{(2)}}}$ the points will have $4$ distinct $y$ coordinate values. \\

${\underline{\mathbf{(1)}}}$  If the points have $3$ distinct $y$ coordinate values, then $(1-x)(P_R(x)) = P_R(x) - x(P_R(x))$ will have some cancelling as multiplying by $-x$ will shift each point to the right one units but will be negative.  Any overlap will result in a cancellation.  Hence, $(1-x)(P_R(x))$ will have only $6$ terms in this case, $3$ inside $FP_{R}$ and $3$ above $FP_{R}$.  Further, the points will be arranged in the following manner:

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw[dashed] (-2,2) -- (5,2);
\draw[dashed] (0,1) -- (5,1);
\draw[dashed] (2,0) -- (5,0);
\draw[thick] (0,1) -- (0,2);
\draw[thick] (2,0) -- (2,1);
\draw (-2,2) node [above] {$+$};
\draw (0,2) node [above] {$-$};
\draw (0,1) node [below] {$+$};
\draw (2,1) node [above] {$-$};
\draw (2,0) node [below] {$+$};
\draw (4,0) node [above] {$-$};
\filldraw 
(-2,2) circle (2pt) node [left] {$(0,\lfloor y(R) \rfloor)$}
(0,1) circle (2pt) node [left] {$(e,\lfloor y(R) \rfloor -1)$}
(2,0) circle (2pt) node [left] {$(f,\lfloor y(R) \rfloor -2)$}
(0,2) circle (2pt)
(2,1) circle (2pt)
(4,0) circle (2pt) node [below] {$(10, \lfloor y(R) \rfloor -2)$};
\end{tikzpicture}
\end{center}
\caption{Layout of lattice points in/around $FP_{R}$ in $6$ term case}
\label{6termFPCR}
\end{figure}

\noindent{where $e,f \in \mathbb{Z}$ and $0 < e,f < 10$.  Note that for point in Figure \ref{6termFPCR} which lay on the same vertical line can be written as (using the $2$ points with $f$ as the $x$-coordinate):}

\begin{center}  $x^f y^{\lfloor y(R) \rfloor -2} - x^f y^{\lfloor y(R) \rfloor -1} = x^f y^{\lfloor y(R) \rfloor -2} (1-y)$. \end{center}
So using Figure \ref{6termFPCR}, we can see that

\begin{center}
\scalebox{0.9}{
\begin{tabular} {r c l}
$(1-x)(P_R (x))$ & $=$ & $y^{\lfloor y(R) \rfloor} + x^e y^{\lfloor y(R) \rfloor - 1} (1-y) + x^f y^{\lfloor y(R) \rfloor -2} (1-y) - x^{10} y^{\lfloor y(R) \rfloor -2}$ \\
$y(1-x)(P_R (x))$ & $=$ & $y^{\lfloor y(R) \rfloor + 1} + x^e y^{\lfloor y(R) \rfloor} (1-y) + x^f y^{\lfloor y(R) \rfloor -1} (1-y) - x^{10} y^{\lfloor y(R) \rfloor -1}$
\end{tabular}}
\end{center}
Hence
\begin{center}
$(1- x^{10} y^{-3}) - y(1-x)(P_R (x)) = (1-y^{\lfloor y(R) \rfloor +1}) - x^e y^{\lfloor y(R) \rfloor} (1-y) - x^f y^{\lfloor y(R) \rfloor -1} (1-y) -x^{10} y^{-3} + x^{10} y^{\lfloor y(R) \rfloor -1}$.
\end{center}
Going back to the sum of the three rational expressions, one for each cone, we have 

\begin{center}  $\frac{P(x)}{(1-x)(1-y)(1-x^{10}y^{-3})}$ \end{center}
where 

\begin{center}
\begin{tabular} {r c l}$P(x)$ & $=$ & $(\lfloor y(R) \rfloor + 1)_y (1-y) - x^e y^{\lfloor y(R) \rfloor} (1-y) - x^f y^{\lfloor y(R) \rfloor -1} (1-y)$ \\
& & $- x^{10} y^{-3} (\lfloor y(R) \rfloor + 2)_y (1-y) + (1-y)[x^{a'} y^{-3} + x^{b'} y^{-2} + x^{c'} y^{-1}]$.
\end{tabular}
\end{center}
We can now cancel (1-y) from this rational expression, so we have 

\begin{center}  
\scalebox{0.85}{
\begin{tabular}{c}
$\frac{(\lfloor y(R) \rfloor + 1)_y - x^e y^{\lfloor y(R) \rfloor} - x^f y^{\lfloor y(R) \rfloor-1} - x^{10} y^{-3} (\lfloor y(R) \rfloor + 2)_y + x^{a'} y^{-3} + x^{b'} y^{-2} + x^{c'} y^{-1}}{(1-x)(1-x^{10} y^{-3})}$.
\end{tabular}}
\end{center}
Now, since we are counting lattice points, we can simplify this expression further by setting $y=1$, hence we now have

\begin{center}  $\frac{(\lfloor y(R) \rfloor + 1) - x^e - x^f - x^{10} (\lfloor y(R) \rfloor + 2) + x^{a'} + x^{b'} + x^{c'}}{(1-x)(1-x^{10})}$.\end{center}
Now consider the limit of this expression as $x \longrightarrow 1$.

\begin{center}
\scalebox{0.9}{
\begin{tabular} {r l}
& $\lim_{x \longrightarrow 1} \frac{(\lfloor y(R) \rfloor + 1) - x^e - x^f - x^{10} (\lfloor y(R) \rfloor + 2) + x^{a'} + x^{b'} + x^{c'}}{(1-x)(1-x^{10})}$ \\
$\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 1} \frac{- ex^{e-1} - fx^{f-1} - 10x^9 (\lfloor y(R) \rfloor + 2) + a' x^{a'-1} + b' x^{b'-1} + c' x^{c'-1}}{-(1-x^{10})(-10x^9)(1-x)}$ \\
$\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 1} \frac{- e(e-1)x^{e-2} - f(f-1)x^{f-2} - 90x^8 (\lfloor y(R) \rfloor + 2)}{10x^9 + 10x^9 +(1-x)(-90x^8)}$ \\
& $+ \frac{a'(a'-1)x^{a'-2} + b'(b'-1)x^{b'-2} + c'(c'-1)x^{c'-2}}{10x^9 + 10x^9 +(1-x)(-90x^8)}$ \\
$=$ & $\frac{-e(e-1) -f(f-1) - 90(\lfloor y(R) \rfloor + 2) +a'(a'-1) + b'(b'-1) + c'(c'-1)}{20}$.
\end{tabular}}
\end{center}
Note that after the first use of L'Hopital's Rule, we get a new identity:

\begin{center}  $- e - f - 10 (\lfloor y(R) \rfloor + 2) + a' + b' + c' = 0 $ or $- 10 (\lfloor y(R) \rfloor + 2) = e + f - a' - b' - c'$.  \end{center}

${\underline{\mathbf{(2)}}}$  If the points have $4$ distinct $y$ coordinate values, then the cancellation will work the same way as the previous case.  Hence, $(1-x)(P_R(x))$ will have only $8$ terms in this case, $4$ inside $FP_{R}$ and $4$ above $FP_{R}$.  Further, the points will be arranged in the following manner:

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw[dashed] (-4,3) -- (5,3);
\draw[dashed] (-2,2) -- (5,2);
\draw[dashed] (0,1) -- (5,1);
\draw[dashed] (2,0) -- (5,0);
\draw[thick] (0,1) -- (0,2);
\draw[thick] (2,0) -- (2,1);
\draw[thick] (-2,3) -- (-2,2);
\draw (-4,3) node [above] {$+$};
\draw (-2,3) node [above] {$-$};
\draw (-2,2) node [below] {$+$};
\draw (0,2) node [above] {$-$};
\draw (0,1) node [below] {$+$};
\draw (2,1) node [above] {$-$};
\draw (2,0) node [below] {$+$};
\draw (4,0) node [above] {$-$};
\filldraw 
(-4,3) circle (2pt) node [left] {$(0,\lfloor y(R) \rfloor)$}
(-2,3) circle (2pt)
(-2,2) circle (2pt) node [left] {$(e,\lfloor y(R) \rfloor -1)$}
(0,1) circle (2pt) node [left] {$(f,\lfloor y(R) \rfloor -2)$}
(2,0) circle (2pt) node [left] {$(g,\lfloor y(R) \rfloor -3)$}
(0,2) circle (2pt)
(2,1) circle (2pt)
(4,0) circle (2pt) node [below] {$(10, \lfloor y(R) \rfloor -3)$};
\end{tikzpicture}
\end{center}
\caption{Layout of lattice points in/around $FP_{R}$ in $8$ term case}
\label{8termFPCR}
\end{figure}

\noindent{where $e,f,g \in \mathbb{Z}$ and $0 < e,f,g < 10$.  Once again, note that the sum of points on the same vertical line in Figure \ref{8termFPCR} can be written as:}

\begin{center}  $x^f y^{\lfloor y(R) \rfloor -2} - x^f y^{\lfloor y(R) \rfloor -1} = x^f y^{\lfloor y(R) \rfloor -2} (1-y)$. \end{center}
So using Figure \ref{8termFPCR}, we can see that

\begin{center}
\begin{tabular} {r c l}
$(1-x)(P_R (x))$ & $=$ & $y^{\lfloor y(R) \rfloor} + x^e y^{\lfloor y(R) \rfloor - 1} (1-y) + x^f y^{\lfloor y(R) \rfloor -2} (1-y)$ \\
& & $+x^g y^{\lfloor y(R) \rfloor -3} (1 - y) - x^{10} y^{\lfloor y(R) \rfloor -3}$ \\
$y(1-x)(P_R (x))$ & $=$ & $y^{\lfloor y(R) \rfloor + 1} + x^e y^{\lfloor y(R) \rfloor} (1-y) + x^f y^{\lfloor y(R) \rfloor -1} (1-y)$ \\
& & $+ x^g y^{\lfloor y(R) \rfloor -2} (1 - y) - x^{10} y^{\lfloor y(R) \rfloor -2}$
\end{tabular}
\end{center}

\noindent{Hence}
\begin{center}
$(1- x^{10} y^{-3}) - y(1-x)(P_R (x)) = (1-y^{\lfloor y(R) \rfloor +1}) - x^e y^{\lfloor y(R) \rfloor} (1-y) - x^f y^{\lfloor y(R) \rfloor -1} (1-y) - x^g y^{\lfloor y(R) \rfloor -2} (1 - y) - x^{10} y^{-3} + x^{10} y^{\lfloor y(R) \rfloor -2}$.
\end{center}
Going back to the sum of the three rational expressions, one for each cone, we have 

\begin{center}  $\frac{P(x)}{(1-x)(1-y)(1-x^{10}y^{-3})}$ \end{center}
where 

\begin{center}
\begin{tabular} {r c l}$P(x)$ & $=$ & $(\lfloor y(R) \rfloor +1)_y (1-y) - x^e y^{\lfloor y(R) \rfloor} (1-y) - x^f y^{\lfloor y(R) \rfloor -1} (1-y)$ \\
& & $- x^g y^{\lfloor y(R) \rfloor - 2} (1 - y) - x^{10} y^{-3} (d+1)_y (1-y)$ \\
& & $+ (1-y)[x^{a'} y^{-3} + x^{b'} y^{-2} + x^{c'} y^{-1}]$.
\end{tabular}
\end{center}
We can now cancel (1-y) from this rational expression, so we have 

\begin{center}  $\frac{(\lfloor y(R) \rfloor +1)_y - x^e y^{\lfloor y(R) \rfloor} - x^f y^{\lfloor y(R) \rfloor -1} - x^g y^{\lfloor y(R) \rfloor - 2} - x^{10} y^{-3} (\lfloor y(R) \rfloor + 1)_y}{(1 - x)(1 - x^{10} y^{-3})}$ \\
$+ \frac{x^{a'} y^{-3} + x^{b'} y^{-2} + x^{c'} y^{-1}}{(1 - x)(1 - x^{10} y^{-3})}$ \end{center}
Now, since we are counting lattice points, we can simplify this expression further by setting $y=1$, hence we now have

\begin{center}  $\frac{(\lfloor y(R) \rfloor + 1) - x^e - x^f - x^g - x^{10} (\lfloor y(R) \rfloor + 1) + x^{a'} + x^{b'} + x^{c'}}{(1-x)(1-x^{10})}$.\end{center}
Now consider the limit of this expression as $x \longrightarrow 1$.

\begin{center}
\scalebox{0.9}{
\begin{tabular} {r l}
& $\lim_{x \longrightarrow 1} \frac{(\lfloor y(R) \rfloor + 1) - x^e - x^f - x^g - x^{10} (\lfloor y(R) \rfloor + 1) + x^{a'} + x^{b'} + x^{c'}}{(1-x)(1-x^{10})}$ \\
$\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 1} \frac{- ex^{e-1} - fx^{f-1} - gx^{g-1} - 10x^9 (\lfloor y(R) \rfloor + 1) + a' x^{a'-1} + b' x^{b'-1} + c' x^{c'-1}}{-(1-x^{10})(-10x^9)(1-x)}$ \\
$\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 1} \frac{- e(e-1)x^{e-2} - f(f-1)x^{f-2} -g(g-1)x^{g-2} - 90x^8 (\lfloor y(R) \rfloor + 1)}{10x^9 + 10x^9 +(1-x)(-90x^8)}$ \\
& $+ \frac{a'(a'-1)x^{a'-2} + b'(b'-1)x^{b'-2} + c'(c'-1)x^{c'-2}}{10x^9 + 10x^9 +(1-x)(-90x^8)}$ \\
$=$ & $\frac{-e(e-1) -f(f-1) - g(g-1) - 90(\lfloor y(R) \rfloor + 1)}{20}$ \\
& $+ \frac{a'(a'-1) + b'(b'-1) + c'(c'-1)}{20}$
\end{tabular}}
\end{center}
Note that after the first use of L'Hopital's Rule, we get a new identity:

\begin{center}  $- e - f - g - 10 (\lfloor y(R) \rfloor + 1) + a' + b' + c' = 0 $ or $- 10 (\lfloor y(R) \rfloor + 1) = e + f + g - a' - b' - c'$.  \end{center}

%Note that when $g = 10$, this results in ${\underline{\mathbf{(1)}}}$, i.e. ${\underline{\mathbf{(2)}}}$ is the more general case, hence we will be focusing on this case.

Now lets focus the possibilities for $FP_{R}$.  Note that the lattice point on the $y$-axis in $FP_{R}$ is $(0,\lfloor y(R) \rfloor)$, then all of the possible number of lattice points at heights $\lfloor y(R) \rfloor$, $\lfloor y(R) \rfloor - 1$, $\lfloor y(R) \rfloor - 2$ and $\lfloor y(R) \rfloor - 3$, respectively, in the fundamental parallelogram are:

\begin{itemize}
\item when $\{ y(R) \} = 0$, then the number of integer points at each height is $1,3,3,3$;
\item when $\{ y(R) \} = \frac{1}{10}$, then the number of integer points at each height is $1,3,4,2$;
\item when $\{ y(R) \} = \frac{2}{10}$, then the number of integer points at each height is $1,4,3,2$;
\item when $\{ y(R) \} = \frac{3}{10}$, then the number of integer points at each height is $2,3,3,2$;
\item when $\{ y(R) \} = \frac{4}{10}$, then the number of integer points at each height is $2,3,4,1$;
\item when $\{ y(R) \} = \frac{5}{10}$, then the number of integer points at each height is $2,4,3,1$;
\item when $\{ y(R) \} = \frac{6}{10}$, then the number of integer points at each height is $3,3,3,1$;
\item when $\{ y(R) \} = \frac{7}{10}$, then the number of integer points at each height is $3,3,4,0$;
\item when $\{ y(R) \} = \frac{8}{10}$, then the number of integer points at each height is $3,4,3,0$;
\item when $\{ y(R) \} = \frac{9}{10}$, then the number of integer points at each height is $4,3,3,0$;
\end{itemize}
so the $6$-term case happens when $\{ \lfloor y(R) \rfloor \} \ge \frac{7}{10}$ and the $8$-term case happens when $0 \le \{ \lfloor y(R) \rfloor \} < \frac{7}{10}$ (or $0 \le \{ \lfloor y(R) \rfloor \} \le \frac{6}{10}$ since these values always have to form $\frac{i}{10}$ where $0 \le i \le 9$ and $i \in \mathbb{Z}_{\ge 0}$). \\

Now lets focus on the possibilities for $FP_{S}$.  Note that the lattice point on the $x$-axis in $FP_{S}$ is $\left( \frac{10}{3}  \lfloor y(R) \rfloor , 0 \right)$, then all of the possible location of lattice points in the fundamental parallelogram are:

\begin{itemize}
\item when $\left \{ \frac{10}{3} \lfloor y(R) \rfloor \right \} = 0$, then the integer points are at $\left( \frac{10}{3} \lfloor y(R) \rfloor, 0 \right)$, \\
$\left( \frac{10}{3} \lfloor y(R) \rfloor -4 , 1 \right)$ and $\left( \frac{10}{3} \lfloor y(R) \rfloor - 7, 2 \right)$;
\item when $\left \{ \frac{10}{3} \lfloor y(R) \rfloor \right \} = \frac{1}{3}$, then the integer points are at $\left( \left \lfloor \frac{10}{3} \lfloor y(R) \rfloor \right \rfloor, 0 \right)$, \\
$\left( \left \lfloor \frac{10}{3} \lfloor y(R) \rfloor \right \rfloor - 3 , 1 \right)$ and $\left( \left \lfloor \frac{10}{3} \lfloor y(R) \rfloor \right \rfloor - 7, 2 \right)$;
\item when $\left \{ \frac{10}{3} \lfloor y(R) \rfloor \right \} = \frac{2}{3}$, then the integer points are at $\left( \left \lfloor \frac{10}{3} \lfloor y(R) \rfloor \right \rfloor, 0 \right)$, \\
 $\left( \left \lfloor \frac{10}{3} \lfloor y(R) \rfloor \right \rfloor - 3 , 1 \right)$ and $\left( \left \lfloor \frac{10}{3} \lfloor y(R) \rfloor \right \rfloor - 6, 2 \right)$;
\end{itemize}
Recall from the $6$-term case, after factoring out and cancelling $(1-y)$, we have 

\begin{center}  
\scalebox{0.85}{
\begin{tabular}{c}
$\frac{(\lfloor y(R) \rfloor + 1)_y - x^e y^{\lfloor y(R) \rfloor} - x^f y^{\lfloor y(R) \rfloor-1} - x^{10} y^{-3} (\lfloor y(R) \rfloor + 2)_y + x^{a'} y^{-3} + x^{b'} y^{-2} + x^{c'} y^{-1}}{(1-x)(1-x^{10} y^{-3})}$. 
\end{tabular}}
\end{center}

Note that since we are counting lattice points with this rational expression, once simplified, this will be a polynomial, thus we know that the numerator is divisible by $(1-x^{10} y^{-3})$.  What this means is that when the points represented are plotted, they all have to be able to be mapped to another point by a multiple of the vector $\begin{bmatrix}\ 10 & -3 \end{bmatrix}$, further, they should cancel based on the sign associated with each point.  This is represented visually in Figure \ref{McNefgabc}.

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}[scale=0.9]
\draw [->] (-1,0.3) -- (14,0.3) node [right] {$x$};
\draw [->] (0.5,-1) -- (0.5,4) node [above] {$y$};
\draw[dashed] (0,0) -- (9,0);
\draw[dashed] (0,0) -- (0,3);
\draw[dashed] (0,3) -- (9,0); 
\draw (0.5,2.6) [fill=black] circle (2pt) node [left] {$(0,d)$};
\draw (1.6,2.6) [red, fill=red] circle (2pt) node [above right] {$(e, d)$};
\draw (2.3,2.4) [brown, fill=brown] circle (2pt) node [below left] {$(f, d-1)$};
\draw (3,2.2) [blue, fill=blue] circle (2pt) node [right] {$(g, d-2)$};
\draw (7.5,0.3) [fill=black] circle (2pt) node [above right] {$(a, 0)$};
\draw (10.2,-0.3) [teal, fill=teal] circle (2pt) node [above right] {$(c', -1)$};
\draw (10.9,-0.5) [purple, fill=purple] circle (2pt) node [below left] {$(b', -2)$};
\draw (11.6,-0.7) [violet, fill=violet] circle (2pt) node [right] {$(a', -3)$};
\draw (10,4) node {where $d = \lfloor y(R) \rfloor$ and $a = \left \lfloor \frac{10}{3} y(R) \right \rfloor$};
\end{tikzpicture}
\end{center}
\caption{Dashed McNugget Triangle with important lattice points indicated $8$ term case (for the $6$ term case, $g = 10$)}
\label{McNefgabc}
\end{figure}

\noindent{Note that the equation for the line segment of the hypothenuse is $3x + 10y= 10 (y(R))$.  Then the location for the remaining unknown coordinates from Figure \ref{McNefgabc} are as follows:}

\begin{itemize}
\item  $e = \left \lfloor \frac{10}{3} \{ y(R) \} \right \rfloor + 1$;
\item  $f = \left \lfloor \frac{10}{3} ( \{ y(R) \} + 1) \right \rfloor + 1$;
\item  $g = \left \lfloor \frac{10}{3} ( \{ y(R) \} + 2) \right \rfloor + 1$;
\item  $a = \left \lfloor \frac{10}{3}  y(R)  \right \rfloor$;
\item  $b = \left \lfloor \frac{10}{3}  (y(R) - 1)  \right \rfloor$;
\item  $c = \left \lfloor \frac{10}{3}  (y(R) - 2)  \right \rfloor$.
\end{itemize}
Now lets look at the difference in the $y$-coordinates of the points with these $x$-coordinates.

\noindent{{\underline{\bf{$6$ term case}}}

\noindent{Lets consider $[(\lfloor y(R) \rfloor - 2) -(-3)] \mod 3 = \lfloor y(R) \rfloor +1 \mod 3$.}

\begin{itemize}
\item  When $\lfloor y(R) \rfloor +1 \mod 3 \equiv 0$ then the points $(10, \lfloor y(R) \rfloor -2)$ and $(a',-3)$ and hence also $(f,\lfloor y(R) \rfloor -1)$ and $(b',-2)$; and $(e, \lfloor y(R) \rfloor)$ and $(c', -1)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that
\begin{itemize}
\item[*]  $10 + 10N = a' \Longrightarrow 10(N+1) = a'$;
\item[*]  $f + 10N = b'$;
\item[*]  $e + 10N = c'$;
\item[*]  $\lfloor y(R) \rfloor - 2 - 3N = -3 \Longrightarrow \lfloor y(R) \rfloor = 3N -1$;
\item[*]  $\lfloor y(R) \rfloor - 1 - 3N = -2 \Longrightarrow \lfloor y(R) \rfloor = 3N -1$;
\item[*]  $\lfloor y(R) \rfloor - 3N = -1 \Longrightarrow \lfloor y(R) \rfloor = 3N -1$;
\end{itemize}
Now substituting the results for $a', b'$ and $c'$ into the numerator of the rational expression for this case we get

\begin{center}  
\begin{tabular} {r l}
& $-e(e-1) -f(f-1) - 90(\lfloor y(R) \rfloor + 2) +a'(a'-1) + b'(b'-1)$ \\
& $+ c'(c'-1)$ \\
$=$ & $-e^2 + e -f^2 + f - 90[(3N -1) + 2] +[10(N+1)][10(N+1)-1]$ \\
& $+ (f+10N)(f+10N -1) + (e+10N)(e+10N -1)$ \\
$=$ & $-e^2 + e -f^2 + f - 270N - 90 +100N^2 + 190N + 90$ \\
& $+ f^2 + 20Nf - f +100N^2 - 10N + e^2 + 20 Ne - e + 100N^2 - 10N$ \\
$=$ & $300N^2 - 100N + 20Ne + 20Nf$
\end{tabular}
\end{center}

So, since the denominator of the rational expression for this case is $20$, then we have
\begin{center}  $15N^2 - 5N + Ne + Nf$.  \end{center}

Since $N = \frac{\lfloor y(R) \rfloor + 1}{3}$, then we have 

\begin{center}
\begin{tabular} {r l}
& $15 \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right)^2 - 5 \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right) + e \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right)$ \\
& $+ f \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right) $ \\
$=$ & $\frac{5}{3} ( \lfloor y(R) \rfloor ^2 + 2 \lfloor y(R) \rfloor + 1) + \frac{e + f -5}{3} (\lfloor y(R) \rfloor +1)$ \\
$=$ & $\frac{5}{3} \lfloor y(R) \rfloor ^2 + \frac{e + f + 5}{3} \lfloor y(R) \rfloor + \frac{e + f}{3}$ \\
$=$ & $\frac{5}{3} (y(R)^2 - 2 y(R) \{ y(R) \} + \{ y(R) \}^2)$ \\
& $+ \frac{e + f + 5}{3} (y(R) - \{ y(R) \} ) + \frac{e + f}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{e + f + 5}{3} \{ y(R) \} + \frac{e + f}{3}$
\end{tabular}
\end{center}

Recall when simplifying the partial fractions, we wanted to write the generating function in the form $f(x) = rx^2 + sx + t$.  Recall the linear coefficient, $s$, was
\begin{center}  $\frac{Aa + Bb + Cc - 2Aa \left \{ \frac{s_1 n}{A} \right \} - 2Bb \left \{ \frac{s_2 n}{B} \right \} - 2Cc \left \{ \frac{s_3 n}{C} \right \}}{2abc}$, \end{center}

thus for $<6,9,20>$ we have 
\begin{center}
\begin{tabular}{r l}
& $\frac{6 + 18 + 60 -12\left \{ \frac{2n}{1} \right \} - 36 \left \{ \frac{n}{2} \right \} - 120 \left \{ \frac{-1n}{3} \right \}}{2 * 6 * 9 *20}$ \\
$=$ & $\frac{6 + 18 + 60 - 36 \left \{ \frac{n}{2} \right \} - 120 \left \{ \frac{2n}{3} \right \}}{2 * 6 * 9 *20}$ \\
$=$ & $\frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) - \frac{\left \{ \frac{n}{2} \right \}}{60} - \frac{\left \{ \frac{2n}{3} \right \}}{18}$.
\end{tabular}
\end{center}

Recall that $y(R) = \frac{n}{60} - \left \{ \frac{2n}{3} \right \} - \frac{3}{10} \left \{ \frac{n}{2} \right \}$ and hence 
\begin{center}  $\frac{10}{3} y(R)^2 = \frac{n^2}{360 * 6} - \left( \frac{1}{18} \left \{ \frac{2n}{3} \right \} + \frac{1}{6} \left \{ \frac{n}{2} \right \} \right) n + \dots$. \end{center}

Thus we have 
\begin{center}
\begin{tabular}{r l}
& $\frac{1}{60} \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) - \left( \frac{1}{18} \left \{ \frac{2n}{3} \right \} + \frac{1}{6} \left \{ \frac{n}{2} \right \} \right)$ \\
$=$ & $\frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) - \frac{\left \{ \frac{n}{2} \right \}}{60} - \frac{\left \{ \frac{2n}{3} \right \}}{18}$ \\
$\Longrightarrow$ & $\frac{1}{60} \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) = \frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) = \frac{7}{180}$ \\
$\Longrightarrow$ & $e + f + 5 - 10 \{ y(R) \} = 7$ \\
$\Longrightarrow$ & $e + f = 2 + 10 \{ y(R) \}$
\end{tabular}
\end{center}

\item  When $\lfloor y(R) \rfloor +1 \mod 3 \equiv 1$ then the points $(10, \lfloor y(R) \rfloor -2)$ and $(b',-2)$ and hence also $(f,\lfloor y(R) \rfloor -1)$ and $(c',-1)$; and $(e, \lfloor y(R) \rfloor)$ and $(a', -3)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that
\begin{itemize}
\item[*]  $10 + 10N = b' \Longrightarrow 10(N+1) = b'$;
\item[*]  $f + 10N = c'$;
\item[*]  $e + 10(N+1) = a'$;
\item[*]  $\lfloor y(R) \rfloor - 2 - 3N = -2 \Longrightarrow \lfloor y(R) \rfloor = 3N$;
\item[*]  $\lfloor y(R) \rfloor - 1 - 3N = -1 \Longrightarrow \lfloor y(R) \rfloor = 3N$;
\item[*]  $\lfloor y(R) \rfloor - 3(N+1) = -3 \Longrightarrow \lfloor y(R) \rfloor = 3N$;
\end{itemize}

Now substituting the results for $a', b'$ and $c'$ into the numerator of the rational expression for this case we get

\begin{center}  
\begin{tabular} {r l}
& $-e(e-1) -f(f-1) - 90(\lfloor y(R) \rfloor + 2) +a'(a'-1) + b'(b'-1)$ \\
& $+ c'(c'-1)$ \\
$=$ & $-e^2 + e -f^2 + f - 90[3N + 2] +[e + 10N + 10][e + 10N + 9]$ \\
& $+ (10N + 10)(10N + 9) + (f+10N)(f+10N -1)$ \\
$=$ & $-e^2 + e -f^2 + f - 270N - 180 +e^2 + 20Ne + 19e + 100N^2 + 190N$ \\
& $+ 100N^2 + 190N + 180 + f^2 + 20 Nf - f + 100N^2 - 10N$ \\
$=$ & $300N^2 + 100N + 20Ne + 20Nf + 20e$
\end{tabular}
\end{center}

So, since the denominator of the rational expression for this case is $20$, then we have
\begin{center}  $15N^2 + 5N + Ne + Nf + e$.  \end{center}

Since $N = \frac{\lfloor y(R) \rfloor}{3}$, then we have 

\begin{center}
\begin{tabular} {r l}
& $15 \left( \frac{\lfloor y(R) \rfloor}{3} \right)^2 + 5 \left( \frac{\lfloor y(R) \rfloor}{3} \right) + e \left( \frac{\lfloor y(R) \rfloor}{3} \right) + f \left( \frac{\lfloor y(R) \rfloor}{3} \right) + e$ \\
$=$ & $\frac{5}{3} \lfloor y(R) \rfloor ^2 + \frac{e + f -5}{3} (\lfloor y(R) \rfloor) + e$ \\
$=$ & $\frac{5}{3} (y(R)^2 - 2 y(R) \{ y(R) \} + \{ y(R) \}^2) + \frac{e + f + 5}{3} (y(R) - \{ y(R) \} ) + e$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{e + f + 5}{3} \{ y(R) \} + e$
\end{tabular}
\end{center}

Similarly to previous case, we have 
\begin{center}
\begin{tabular}{r l}
& $\frac{1}{60} \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) - \left( \frac{1}{18} \left \{ \frac{2n}{3} \right \} + \frac{1}{6} \left \{ \frac{n}{2} \right \} \right)$ \\
$=$ & $\frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) - \frac{\left \{ \frac{n}{2} \right \}}{60} - \frac{\left \{ \frac{2n}{3} \right \}}{18}$ \\
%$\Longrightarrow$ & $\frac{1}{60} \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) = \frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) = \frac{7}{180}$ \\
%$\Longrightarrow$ & $e + f + 5 - 10 \{ y(R) \} = 7$ \\
$\Longrightarrow$ & $e + f = 2 + 10 \{ y(R) \}$
\end{tabular}
\end{center}

\item  When $\lfloor y(R) \rfloor +1 \mod 3 \equiv 2$ then the points $(10, \lfloor y(R) \rfloor -2)$ and $(c',-1)$ and hence also $(f,\lfloor y(R) \rfloor -1)$ and $(a',-3)$; and $(e, \lfloor y(R) \rfloor)$ and $(b', -2)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that
\begin{itemize}
\item[*]  $10 + 10N = c' \Longrightarrow 10(N+1) = c'$;
\item[*]  $f + 10(N + 1) = a'$;
\item[*]  $e + 10(N+1) = b'$;
\item[*]  $\lfloor y(R) \rfloor - 2 - 3N = -1 \Longrightarrow \lfloor y(R) \rfloor = 3N + 1$;
\item[*]  $\lfloor y(R) \rfloor - 1 - 3(N + 1) = -3 \Longrightarrow \lfloor y(R) \rfloor = 3N + 1$;
\item[*]  $\lfloor y(R) \rfloor - 3(N+1) = -2 \Longrightarrow \lfloor y(R) \rfloor = 3N + 1$;
\end{itemize}

Now substituting the results for $a', b'$ and $c'$ into the numerator of the rational expression for this case we get

\begin{center}  
\begin{tabular} {r l}
& $-e(e-1) -f(f-1) - 90(\lfloor y(R) \rfloor + 2) +a'(a'-1) + b'(b'-1)$ \\
& $+ c'(c'-1)$ \\
$=$ & $-e^2 + e -f^2 + f - 90[3N + 3] +[f + 10N + 10][f + 10N + 9]$ \\
& $+ (e + 10N + 10)(e + 10N + 9) + (10N + 10)(10N + 9)$ \\
$=$ & $-e^2 + e -f^2 + f - 270N - 270 +f^2 + 20Nf + 19f + 100N^2 + 190N$ \\
& $+ e^2 + 20Ne + 19e + 100N^2 + 190N + 100N^2 + 190N + 270$ \\
$=$ & $300N^2 + 300N + 20Ne + 20Nf + 20e + 20f$
\end{tabular}
\end{center}

So, since the denominator of the rational expression for this case is $20$, then we have
\begin{center}  $15N^2 + 15N + Ne + Nf + e + f$.  \end{center}

Since $N = \frac{\lfloor y(R) \rfloor - 1}{3}$, then we have 

\begin{center}
\begin{tabular} {r l}
& $15 \left( \frac{\lfloor y(R) \rfloor - 1}{3} \right)^2 + 15 \left( \frac{\lfloor y(R) \rfloor - 1}{3} \right) + e \left( \frac{\lfloor y(R) \rfloor - 1}{3} \right)$ \\
& $+ f \left( \frac{\lfloor y(R) \rfloor - 1}{3} \right) + e + f$ \\
$=$ & $\frac{5}{3} ( \lfloor y(R) \rfloor ^2 - 2\lfloor y(R) \rfloor + 1) + \frac{15}{3} (\lfloor y(R) \rfloor - 1) + \frac{e + f}{3} (\lfloor y(R) \rfloor - 1)$ \\
& $+ e + f$ \\
\end{tabular}
\begin{tabular}{r l}
$=$ & $\frac{5}{3} ( \lfloor y(R) \rfloor ^2 - 2\lfloor y(R) \rfloor + 1) + \frac{e + f +15}{3} (\lfloor y(R) \rfloor - 1) + e + f$ \\
$=$ & $\frac{5}{3} \lfloor y(R) \rfloor ^2 + \left ( \frac{e + f +5}{3} \right ) \lfloor y(R) \rfloor - \left ( 
\frac{e + f + 10}{3} \right )+ e + f$ \\
$=$ & $\frac{5}{3} ( y(R)^2 - 2 y(R) \{ y(R) \} + \{ y(R) \}^2) + \left( \frac{e + f + 5}{3} \right) (y(R) - \{ y(R) \}) $ \\
& $+ \frac{2e + 2f - 10}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left ( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right ) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \left ( \frac{e + f + 5}{3} \right ) \{ y(R) \} + \frac{2e + 2f - 10}{3}$
\end{tabular}
\end{center}

Similarly to previous case, we have 
\begin{center}
\begin{tabular}{r l}
& $\frac{1}{60} \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) - \left( \frac{1}{18} \left \{ \frac{2n}{3} \right \} + \frac{1}{6} \left \{ \frac{n}{2} \right \} \right)$ \\
$=$ & $\frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) - \frac{\left \{ \frac{n}{2} \right \}}{60} - \frac{\left \{ \frac{2n}{3} \right \}}{18}$ \\
%$\Longrightarrow$ & $\frac{1}{60} \left( \frac{e + f + 5}{3} - \frac{10}{3} \{ y(R) \} \right) = \frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) = \frac{7}{180}$ \\
%$\Longrightarrow$ & $e + f + 5 - 10 \{ y(R) \} = 7$ \\
$\Longrightarrow$ & $e + f = 2 + 10 \{ y(R) \}$
\end{tabular}
\end{center}
\end{itemize}

\noindent{{\underline{\bf{$8$ term case}}}

\noindent{Recall that the numerator for this case is:}
\begin{center}  $-e(e-1) -f(f-1) - g(g-1) - 90(\lfloor y(R) \rfloor + 1) +a'(a'-1) + b'(b'-1) + c'(c'-1)$,  \end{center}
and that we have the identity $- 10 (\lfloor y(R) \rfloor + 1) = e + f + g - a' - b' - c'$.  So when simplifying, we have 
\begin{center}
\begin{tabular} { r l}
& $-e(e-1) -f(f-1) - g(g-1) - 90(\lfloor y(R) \rfloor + 1)$ \\
& $+a'(a'-1) + b'(b'-1) + c'(c'-1)$ \\
$=$ & $-e^2 + e - f^2 + f - g^2 + g - 90 \lfloor y(R) \rfloor - 90 + (a')^2 - a' + (b')^2 - b'$ \\
& $+(c')^2 - c'$ \\
$=$ & $-e^2 - f^2 - g^2 - 90 \lfloor y(R) \rfloor  - 90 + (a')^2 + (b')^2 + (c')^2 + e + f + g - a'$ \\
& $- b' - c'$ \\
$=$ & $-e^2 - f^2 - g^2 - 90 \lfloor y(R) \rfloor  - 90 + (a')^2 + (b')^2 + (c')^2 - 10(\lfloor y(R) \rfloor + 1)$ \\
$=$ & $-e^2 - f^2 - g^2 - 100 ( \lfloor y(R) \rfloor + 1) + (a')^2 + (b')^2 + (c')^2$.
\end{tabular}
\end{center}
Now, like the previous case, consider $\lfloor y(R) \rfloor +1 \mod 3$.

\begin{itemize}
\item  When $\lfloor y(R) \rfloor +1 \mod 3 \equiv 0$ then the points $(g, \lfloor y(R) \rfloor -2)$ and $(a',-3)$ and hence also $(f,\lfloor y(R) \rfloor -1)$ and $(b',-2)$; and $(e, \lfloor y(R) \rfloor)$ and $(c', -1)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that
\begin{itemize}
\item[*]  $g + 10N = a'$;
\item[*]  $f + 10N = b'$;
\item[*]  $e + 10N = c'$;
\item[*]  $\lfloor y(R) \rfloor - 2 - 3N = -3 \Longrightarrow \lfloor y(R) \rfloor = 3N -1$;
\item[*]  $\lfloor y(R) \rfloor - 1 - 3N = -2 \Longrightarrow \lfloor y(R) \rfloor = 3N -1$;
\item[*]  $\lfloor y(R) \rfloor - 3N = -1 \Longrightarrow \lfloor y(R) \rfloor = 3N -1$;
\end{itemize}
Now substituting the results for $a', b'$ and $c'$ into the numerator of the rational expression for this case we get

\begin{center}  
\begin{tabular} {r l}
& $-e^2 -f^2 - g^2 - 100(3N) +(g + 10N)^2 + (f + 10N)^2 + (e + 10N)^2$ \\
$=$ & $-e^2 - f^2  - g^2 -  300N + (g^2 + 20gN + 100N^2)$ \\
&  $+ (f^2 + 20fN + 100N^2) + (e^2 + 20eN + 100N^2)$ \\
$=$ & $300N^2 - 300N + 20eN + 20fN + 20gN$
\end{tabular}
\end{center}

So, since the denominator of the rational expression for this case is $20$, then we have
\begin{center}  $15N^2 - 15N + eN + fN + gN$.  \end{center}

Since $N = \frac{\lfloor y(R) \rfloor + 1}{3}$, then we have 

\begin{center}
\begin{tabular} {r l}
& $15 \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right)^2 - 15 \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right) + e \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right)$ \\
& $+ f \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right) + g \left( \frac{\lfloor y(R) \rfloor + 1}{3} \right) $ \\
$=$ & $\frac{5}{3} ( \lfloor y(R) \rfloor ^2 + 2 \lfloor y(R) \rfloor + 1) + \frac{e + f + g - 15}{3} (\lfloor y(R) \rfloor +1)$ \\
$=$ & $\frac{5}{3} \lfloor y(R) \rfloor ^2 + \frac{e + f + g - 5}{3} \lfloor y(R) \rfloor + \frac{e + f + g - 10}{3}$ \\
$=$ & $\frac{5}{3} (y(R)^2 - 2 y(R) \{ y(R) \} + \{ y(R) \}^2) + \frac{e + f + g - 5}{3} (y(R) - \{ y(R) \} )$ \\
& $+ \frac{e + f + g - 10}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{e + f + g - 5}{3} \{ y(R) \} + \frac{e + f + g - 10}{3}$
\end{tabular}
\end{center}

Now using the same technique for comparing the linear coefficients used in the $6$ term case, we have 
\begin{center}
\begin{tabular}{r l}
& $\frac{1}{60} \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) - \left( \frac{1}{18} \left \{ \frac{2n}{3} \right \} + \frac{1}{6} \left \{ \frac{n}{2} \right \} \right)$ \\
$=$ & $\frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) - \frac{\left \{ \frac{n}{2} \right \}}{60} - \frac{\left \{ \frac{2n}{3} \right \}}{18}$ \\
$\Longrightarrow$ & $\frac{1}{60} \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) = \frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) = \frac{7}{180}$ \\
$\Longrightarrow$ & $e + f + g - 5 - 10 \{ y(R) \} = 7$ \\
$\Longrightarrow$ & $e + f + g = 12 + 10 \{ y(R) \}$.
\end{tabular}
\end{center}

Now if we plug this result into our counting function we get:

\begin{center}
\begin{tabular} {r l}
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{e + f + g - 5}{3} \{ y(R) \} + \frac{e + f + g - 10}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{12 + 10\{ y(R) \} - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{12 + 10 \{ y(R) \} - 5}{3} \{ y(R) \} + \frac{12 + 10 \{ y(R) \} - 10}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \frac{7}{3} y(R) + \frac{5}{3} \{ y(R) \}^2 - \frac{7 + 10 \{ y(R) \}}{3} \{ y(R) \} + \frac{2 + 10 \{ y(R) \}}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 + \{ y(R) \} + \frac{2}{3}$
\end{tabular}
\end{center}

\item  When $\lfloor y(R) \rfloor +1 \mod 3 \equiv 1$ then the points $(g, \lfloor y(R) \rfloor -2)$ and $(b',-2)$ and hence also $(f,\lfloor y(R) \rfloor -1)$ and $(c',-1)$; and $(e, \lfloor y(R) \rfloor)$ and $(a', -3)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that
\begin{itemize}
\item[*]  $g + 10N = b'$;
\item[*]  $f + 10N = c'$;
\item[*]  $e + 10(N + 1) =  e + 10N + 1 = a'$;
\item[*]  $\lfloor y(R) \rfloor - 2 - 3N = -2 \Longrightarrow \lfloor y(R) \rfloor = 3N$;
\item[*]  $\lfloor y(R) \rfloor - 1 - 3N = -1 \Longrightarrow \lfloor y(R) \rfloor = 3N$;
\item[*]  $\lfloor y(R) \rfloor - 3(N + 1) = -3 \Longrightarrow \lfloor y(R) \rfloor = 3N$;
\end{itemize}

Now substituting the results for $a', b'$ and $c'$ into the numerator of the rational expression for this case we get

\begin{center}  
\begin{tabular} {r l}
& $-e^2 -f^2 - g^2 - 100(3N + 1) +(e + 10N + 10)^2 + (g + 10N)^2$ \\
& $+ (f + 10N)^2$ \\
$=$ & $-e^2 - f^2  - g^2 -  300N - 100 + e^2 + 20eN + 20e + 100N^2 + 200N$ \\
& $+ 100 + g^2 + 20gN + 100N^2 + f^2 + 20fN + 100N^2$ \\
$=$ & $300N^2 - 100N + 20eN + 20fN + 20gN + 20e$
\end{tabular}
\end{center}

So, since the denominator of the rational expression for this case is $20$, then we have
\begin{center}  $15N^2 - 5N + eN + fN + gN + e$.  \end{center}

Since $N = \frac{\lfloor y(R) \rfloor}{3}$, then we have 

\begin{center}
\begin{tabular} {r l}
& $15 \left( \frac{\lfloor y(R) \rfloor}{3} \right)^2 - 5 \left( \frac{\lfloor y(R) \rfloor}{3} \right) + (e + f + g) \left( \frac{\lfloor y(R) \rfloor}{3} \right) + e$ \\
$=$ & $\frac{5}{3} \lfloor y(R) \rfloor ^2 - \frac{5}{3} \lfloor y(R) \rfloor + \frac{e + f + g}{3} \lfloor y(R) \rfloor + e$ \\
\end{tabular}
\begin{tabular}{r l}
$=$ & $\frac{5}{3} (y(R) ^2 - 2 y(R) \{ y(R) \} + \{ y(R) \} ^2) + \frac{e + f + g - 5}{3} (y(R) - \{ y(R) \})$ \\
& $+ e$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{e + f + g - 5}{3} \{ y(R) \} + e$
\end{tabular}
\end{center}

Similarly to previous case, we have  
\begin{center}
\begin{tabular}{r l}
& $\frac{1}{60} \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) - \left( \frac{1}{18} \left \{ \frac{2n}{3} \right \} + \frac{1}{6} \left \{ \frac{n}{2} \right \} \right)$ \\
$=$ & $\frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) - \frac{\left \{ \frac{n}{2} \right \}}{60} - \frac{\left \{ \frac{2n}{3} \right \}}{18}$ \\
$\Longrightarrow$ & $e + f + g = 12 + 10 \{ y(R) \}$
\end{tabular}
\end{center}

Now if we plug this result into our counting function we get:

\begin{center}
\begin{tabular} {r l}
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2 $ \\
& $- \frac{e + f + g - 5}{3} \{ y(R) \} + e$\\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{12 + 10\{ y(R) \} - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{12 + 10 \{ y(R) \} - 5}{3} \{ y(R) \} + e$ \\
$=$ & $\frac{5}{3} y(R)^2 + \frac{7}{3} y(R) + \frac{5}{3} \{ y(R) \}^2 - \frac{7 + 10 \{ y(R) \}}{3} \{ y(R) \} + e$ \\
$=$ & $\frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 - \frac{7}{3} \{ y(R) \} + e$
\end{tabular}
\end{center}

\item  When $\lfloor y(R) \rfloor +1 \mod 3 \equiv 2$ then the points $(g, \lfloor y(R) \rfloor -2)$ and $(c',-1)$ and hence also $(f,\lfloor y(R) \rfloor -1)$ and $(a',-3)$; and $(e, \lfloor y(R) \rfloor)$ and $(b', -2)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that
\begin{itemize}
\item[*]  $g + 10N = c'$;
\item[*]  $f + 10(N + 1) = f + 10N + 10 = a'$;
\item[*]  $e + 10(N + 1) =  e + 10N + 1 = b'$;
\item[*]  $\lfloor y(R) \rfloor - 2 - 3N = -1 \Longrightarrow \lfloor y(R) \rfloor = 3N + 1$;
\item[*]  $\lfloor y(R) \rfloor - 1 - 3(N + 1) = -3 \Longrightarrow \lfloor y(R) \rfloor = 3N + 1$;
\item[*]  $\lfloor y(R) \rfloor - 3(N + 1) = -2 \Longrightarrow \lfloor y(R) \rfloor = 3N + 1$;
\end{itemize}

Now substituting the results for $a', b'$ and $c'$ into the numerator of the rational expression for this case we get

\begin{center}  
\begin{tabular} {r l}
& $-e^2 -f^2 - g^2 - 100(3N + 2) +(f + 10N + 10)^2$ \\
& $+ (e + 10N  +10)^2 + (g + 10N)^2$ \\
$=$ & $-e^2 - f^2  - g^2 -  300N - 200 + f^2 + 20fN + 20f + 100N^2 + 200N$ \\
& $+ 100 + e^2 + 20eN + 20e + 100N^2 + 200N + 100 + g^2 + 20gN$ \\
& $+ 100N^2$ \\
$=$ & $300N^2 + 100N + 20eN + 20fN + 20gN + 20e + 20f$
\end{tabular}
\end{center}

So, since the denominator of the rational expression for this case is $20$, then we have
\begin{center}  $15N^2 + 5N + eN + fN + gN + e + f$.  \end{center}

Since $N = \frac{\lfloor y(R) \rfloor - 1}{3}$, then we have 

\begin{center}
\begin{tabular} {r l}
& $15 \left( \frac{\lfloor y(R) \rfloor - 1}{3} \right)^2 + 5 \left( \frac{\lfloor y(R) \rfloor - 1}{3} \right) + (e + f + g) \left( \frac{\lfloor y(R) \rfloor - 1}{3} \right)$ \\
& $+ e + f$ \\
$=$ & $\frac{5}{3} ( \lfloor y(R) \rfloor ^2 - 2 \lfloor y(R) \rfloor + 1) + \left( \frac{e + f + g + 5}{3} \right) (\lfloor y(R) \rfloor - 1) + e + f$ \\
\end{tabular}

\begin{tabular}{r l}
$=$ & $\frac{5}{3} \lfloor y(R) \rfloor ^2 + \frac{e + f + g - 5}{3} \lfloor y(R) \rfloor + \frac{2e + 2f - g}{3}$ \\
$=$ & $\frac{5}{3} (y(R) ^2 - 2 y(R) \{ y(R) \} + \{ y(R) \} ^2) + \frac{e + f + g - 5}{3} (y(R) - \{ y(R) \})$ \\
& $+ \frac{2e + 2f - g}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{e + f + g - 5}{3} \{ y(R) \} + \frac{2e + 2f - g}{3}$
\end{tabular}
\end{center}

Similarly to previous case, we have  
\begin{center}
\begin{tabular}{r l}
& $\frac{1}{60} \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) - \left( \frac{1}{18} \left \{ \frac{2n}{3} \right \} + \frac{1}{6} \left \{ \frac{n}{2} \right \} \right)$ \\
$=$ & $\frac{1}{2} \left( \frac{1}{3*60} + \frac{1}{60} + \frac{1}{18} \right) - \frac{\left \{ \frac{n}{2} \right \}}{60} - \frac{\left \{ \frac{2n}{3} \right \}}{18}$ \\
$\Longrightarrow$ & $e + f + g = 12 + 10 \{ y(R) \}$
\end{tabular}
\end{center}

Now if we plug this result into our counting function we get:

\begin{center}
\begin{tabular} {r l}
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{e + f + g - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{e + f + g - 5}{3} \{ y(R) \} + \frac{2e + 2f - g}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \left( \frac{12 + 10\{ y(R) \} - 5}{3} - \frac{10}{3} \{ y(R) \} \right) y(R) + \frac{5}{3} \{ y(R) \}^2$ \\
& $- \frac{12 + 10 \{ y(R) \} - 5}{3} \{ y(R) \} + \frac{2e + 2f - g}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \frac{7}{3} y(R) + \frac{5}{3} \{ y(R) \}^2 - \frac{7 + 10 \{ y(R) \}}{3} \{ y(R) \} + \frac{2e + 2f - g}{3}$ \\
$=$ & $\frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 - \frac{7}{3} \{ y(R) \} + \frac{2e + 2f - g}{3}$
\end{tabular}
\end{center}
\end{itemize}

Looking back at the $3$ results for both cases, notice once again that the $6$ term case is just a special case for the more general $8$ term case, as when $g=10$ we get precisely the $6$ term results. \\

Next, note from this result from the general case $e + f + g - 10 \{ y(R) \} = 12$, and the previous identity $a' + b' + c' = e + f + g + 10(\lfloor y(R) \rfloor + 1)$, then we have 

\begin{center}
\begin{tabular} {r c l}
$a' + b' + c'$ & $=$ & $12 + 10 \{ y(R) \} + 10 ( \lfloor y(R) \rfloor + 1)$ \\
$\Longrightarrow a + b + c + 33$ & $=$ & $12 + 10 \{ y(R) \} + 10(y(R) - \{ y(R) \} ) + 10$ \\
$\Longrightarrow a + b + c + 33$ & $=$ & $10y(R) + 22$ \\
$\Longrightarrow a + b + c$ & $=$ & $10y(R) - 11 = \left( \frac{n}{6} - 10 \left \{ \frac{2n}{3} \right \} - 3 \left \{ \frac{n}{2} \right \} \right ) - 11$
\end{tabular}
\end{center}

Now lets compare the $3$ results of the general case against each other by taking their differences:

\begin{center}
\begin{tabular} {r l }

& $\left( \frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 - \frac{7}{3} \{ y(R) \} + \frac{2e + 2f - g}{3} \right)$ \\
& $- \left( \frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 - \frac{7}{3} \{ y(R) \} + e \right )$ \\
$=$ & $\frac{-e + 2f - g}{3}$; \\
& $\left( \frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 - \frac{7}{3} \{ y(R) \} + e \right)$ \\
& $- \left( \frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 + \{ y(R) \} + \frac{2}{3} \right)$ \\
$=$ & $- \frac{10}{3} \{ y(R) \} - \frac{2}{3} + e$; and \\
& $\left( \frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 - \frac{7}{3} \{ y(R) \} + \frac{2e + 2f - g}{3} \right)$ \\
& $- \left( \frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 + \{ y(R) \} + \frac{2}{3} \right)$ \\
$=$ & $\frac{2e + 2f - g - 2 - 10 \{ y(R) \}}{3}$
\end{tabular}
\end{center}

\noindent{Let's denote $\alpha_0 =\frac{2e + 2f - g - 2 - 10 \{ y(R) \}}{3}$ and $\alpha_1 = - \frac{10}{3} \{ y(R) \} - \frac{2}{3} + e$.}

Now lets look at all the possible values for $\{ y(R) \}$ and see what the results for these differences are

\begin{center}
\scalebox{0.9}{
\begin{tabular} {| c | c | c | c | c | c | c | c | c | c | c |}
\hline
& $0$ & $\frac{1}{10}$ & $\frac{2}{10}$ & $\frac{3}{10}$ & $\frac{4}{10}$ & $\frac{5}{10}$ & $\frac{6}{10}$ & $\frac{7}{10}$ & $\frac{8}{10}$ & $\frac{9}{10}$  \\ \hline
$e$ & $1$ & $1$ & $1$ & $2$ & $2$ & $2$ & $3$ & $3$ & $3$ & $4$  \\ \hline
$f$ & $4$ & $4$ & $5$ & $5$ & $5$ & $6$ & $6$ & $6$ & $7$ & $7$  \\ \hline
$g$ & $7$ & $8$ & $8$ & $8$ & $9$ & $9$ & $9$ & $10$ & $10$ & $10$  \\ \hline
$\frac{-e + 2f - g}{3}$ & $0$ & $-\frac{1}{3}$ & $\frac{1}{3}$ & $0$ & $-\frac{1}{3}$ & $\frac{1}{3}$ & $0$ & $-\frac{1}{3}$ & $\frac{1}{3}$ & $0$  \\ \hline
$- \frac{10}{3} \{ y(R) \} - \frac{2}{3} + e$ & $\frac{1}{3}$ & $0$ & $-\frac{1}{3}$ & $\frac{1}{3}$ & $0$ & $-\frac{1}{3}$ & $\frac{1}{3}$ & $0$ & $-\frac{1}{3}$ & $\frac{1}{3}$  \\ \hline
$\frac{2e + 2f - g - 2 - 10 \{ y(R) \}}{3}$ & $\frac{1}{3}$ & $-\frac{1}{3}$ & $0$ & $\frac{1}{3}$ & $-\frac{1}{3}$ & $0$ & $\frac{1}{3}$ & $-\frac{1}{3}$ & $0$ & $\frac{1}{3}$  \\ \hline
\end{tabular}}
\end{center}

\noindent{Therefore, the only difference amongst these $3$ results is either $0, \frac{1}{3}$ or $-\frac{1}{3}$.}  Using the table above we have the following formulas for $e, f$ and $g$:

\begin{center}
\begin{tabular}{r c l}
$e$ & $=$ & $1 + \left \lfloor \frac{10}{3} \{ y(R) \} \right \rfloor$ \\
$f$ & $=$ & $4 + \left \lfloor \frac{1}{3} (10 \{ y(R) \} + 1) \right \rfloor$ \\
$g$ & $=$ & $7 + \left \lfloor \frac{1}{3} (10 \{ y(R) \} + 2) \right \rfloor$.
\end{tabular}
\end{center}

When plugging these formulas into the differences calculated above we get:

\begin{center}
\begin{tabular}{r c l}
$\alpha_0$ & $=$ & $\frac{2}{3} \Bigg(1 + \left \lfloor \frac{10}{3} \{ y(R) \} \right \rfloor \Bigg) + \frac{2}{3} \Bigg( 4 + \left \lfloor \frac{1}{3} (10 \{ y(R) \} + 1) \right \rfloor \Bigg)$ \\
& & $- \frac{1}{3} \Bigg( 7 + \left \lfloor \frac{1}{3} (10 \{ y(R) \} + 2) \right \rfloor \Bigg) - \frac{2}{3} - \frac{10}{3} \{ y(R) \}$ \\
& $=$ & $\frac{1}{3} \Bigg( 1 - 2 \left \{ \frac{10}{3} \{ y(R) \} \right \} - 2 \left \{ \frac{10}{3} \{ y(R) \}  + \frac{1}{3} \right \} + \left \{ \frac{10}{3} \{ y(R) \} + \frac{2}{3} \right \} \Bigg)$ \\
and & & \\
$\alpha_1$ & $=$ & $- \frac{10}{3} \{ y(R) \} - \frac{2}{3} + \Bigg( 1 + \left \lfloor \frac{10}{3} \{ y(R) \} \right \rfloor \Bigg)$ \\
& $=$ & $\frac{1}{3} - \left \{ \frac{10}{3} \{ y(R) \} \right \}$.
\end{tabular}
\end{center}

Therefore, for the McNugget Problem, we have 
\begin{center}
$f(n) = \frac{5}{3} y(R)^2 + \frac{7}{3} y(R) - \frac{5}{3} \{ y(R) \}^2 + \{ y(R) \} + \frac{2}{3} + \left \lfloor \left \lfloor \frac{y(R)}{3} + 1 \right \rfloor - \frac{y(R)+2}{3} \right \rfloor \alpha_0 + \left \lfloor \left \lfloor \frac{y(R)+2}{3} + 1 \right \rfloor - \frac{y(R)}{3} \right \rfloor \alpha_1$,
\end{center}

\noindent{\Bigg(Recall that $y(R) = \frac{n}{60} - \left \{ \frac{2n}{3} \right \} - \frac{3}{10} \left \{ \frac{n}{2} \right \}$ \Bigg)}.

\section{Other Families}

Now let's consider a monoid with positive integer generators $<1,p,q>$, where $\gcd (p,q) = 1$.  Luckily, at this point, we have a lot of information about the general case along with a geometric approach from $<6,9,20>$ that we can, at least attempt, to replicate.

\subsection{${\mathbf{<1,p,q>}}$}

Consider $<1,p,q>$ where $\gcd(p,q)=1$.  Using the same technique that we used for the $<6,9,20>$, we can find a matrix $A \in SL_2(\mathbb{Z})$ which transforms this triangle from a $3$ dimensional space into a $2$ dimensional space.  The resulting space is again a right triangle, and since the $\gcd(p,q) = 1$, there is no margins.  Hence we have the following:

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0) -- (10,0) node [right] {$x$};
\draw [->] (0,-1) -- (0,4) node [above] {$y$};
\draw[thick] (0,0) -- (9,0) node [above right] {$\left( \frac{q}{p} h, 0 \right)$};
\draw[thick] (0,0) -- (0,3) node [left] {$\left( 0, h \right)$};
\draw[thick] (0,3) -- (4.5,1.5) node [above right] {$y = -\frac{q}{p}x + h$};
\draw[thick] (4.5,1.5) -- (9,0);
\end{tikzpicture}
\end{center}
\caption{Transformed and Translated $<1,p,p+1>$ triangle after changing basis back to $x,y$.}
\label{1pq2D}
\end{figure}

\noindent{Now, using Brion, we know that the number of lattice points can be found using}

\begin{center}  
\begin{tabular} {r l}
& $\frac{1}{(1-x)(1-y)} + \frac{q \text{ terms}}{(1-y^{-1})(1-x^{q} y^{-p})} + \frac{p \text{ terms}}{(1-x^{-1})(1-x^{-q} y^p)}$ \\
$=$ & $\frac{(1 - x^{q}y^{-p})}{(1-x)(1-y)(1 - x^{q}y^{-p})} - \frac{y(1-x) [q \text{ terms}]}{(1-x)(1-y)(1-x^{q} y^{-p})}$ \\
& $+ \frac{(1-y) (x^{q+1} y^{-p})[p \text{ terms}]}{(1-x)(1-y)(1-x^{q} y^{-p})}$ \\
$=$ & $\frac{(1 - x^{q}y^{-p}) - y[2p \text{ or } 2(p+1) \text{ terms}] + (1-y) (x^{q+1} y^{-p})[p \text{ terms}]}{(1-x)(1-y)(1-x^{q} y^{-p})}$.
\end{tabular}
\end{center}
Let $d = \lfloor h \rfloor$.  Note that in the $2(p+1)$ case above, we have

\begin{center}  $(1-x)[q \text{ terms}] = y^d + x^{e_1} y^{d-1} (1-y) + x^{e_2} y^{d-2} (1-y) + \dots + x^{e_p} y^{d-p} (1-y) - x^q y^{d-p}$, \end{center}
and in the $2p$ case above, we have

\begin{center}  $(1-x)[q \text{ terms}] = y^d + x^{e_1} y^{d-1} (1-y) + x^{e_2} y^{d-2} (1-y) + \dots + x^{e_{p-1}} y^{d-p+1} (1-y) - x^q y^{d-p}$. \end{center}

\noindent{{\underline{\bf{{$2(p+1)$ terms case}}}}

Using the same reasoning from the $<6,9,20>$, we know that the $2(p+1)$ case for this monoid is the general case and hence we will focus on that.  Looking at the numerator of the above rational expression, we can rewrite it as follows:

\begin{center}
\begin{tabular}{r l}
& $(1 - x^{q}y^{-p}) - y(y^d + x^{e_1} y^{d-1} (1-y) + \dots + x^{e_p} y^{d-p} (1-y) - x^q y^{d-p})$ \\
& $+ (1-y) (x^{q+1} y^{-p})[p \text{ terms}]$ \\
$=$ & $(1 - x^{q}y^{-p}) - y^{d+1} - x^{e_1} y^d (1-y) - \dots - x^{e_p} y^{d-p+1} (1-y)$ \\
& $ + x^q y^{d-p+1} + (1-y) (x^{q+1} y^{-p})[p \text{ terms}]$ \\
$=$ & $(1-y^{d+1}) - x^{e_1} y^d (1-y) - \dots - x^{e_p} y^{d-p+1} (1-y) + (x^qy^{d-p+1} - x^q y^{-p})$ \\
& $+ (1-y) (x^{q+1} y^{-p})[p \text{ terms}]$ \\
$=$ & $(d+1)_y (1-y) - x^{e_1} y^d (1-y) - \dots - x^{e_p} y^{d-p+1} (1-y)$ \\
& $-x^q y^{-p} (d+1)_y (1-y) + (1-y) (x^{q+1} y^{-p})[p \text{ terms}]$
\end{tabular}
\end{center}
Now writing the complete rational expression we have 

\begin{center}
\begin{tabular}{r l}
& $\frac{(d+1)_y (1-y) - x^{e_1} y^d (1-y) - \dots - x^{e_p} y^{d-p+1} (1-y)}{(1-x)(1-y)(1-x^{q} y^{-p})}$ \\
& $\frac{-x^q y^{-p} (d+1)_y (1-y) + (1-y) (x^{q+1} y^{-p})[p \text{ terms}]}{(1-x)(1-y)(1-x^{q} y^{-p})}$ \\
$=$ & $\frac{(d+1)_y - x^{e_1} y^d - \dots - x^{e_p} y^{d-p+1} - x^q y^{-p} (d+1)_y + (x^{q+1} y^{-p})[p \text{ terms}]}{(1-x)(1-x^{q} y^{-p})}$.
\end{tabular}
\end{center}
Since we are counting lattice points, we can now set $y = 1$ and hence we have 

\begin{center}  $\frac{(d+1) - x^{e_1} - \dots - x^{e_p} - x^q (d+1) + x^{b_1} + x^{b-2} + \dots + x^{b_p}}{(1-x)(1-x^{q})}$,  \end{center}
where $b_i = a_{p-i} + q + 1$.  Now consider the limit of this expression as $x \longrightarrow 1$.

\begin{center}
\begin{tabular} {r l}
& $\lim_{x \longrightarrow 1} \frac{(d+1) - x^{e_1} - \dots - x^{e_p} - x^q (d+1) + x^{b_1} + x^{b-2} + \dots + x^{b_p}}{(1-x)(1-x^{q})}$ \\
$\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 1} \frac{- e_1 x^{e_1-1} - \dots - e_p x^{e_p-1} - (d+1)qx^{q-1} + b_1 x^{b_1 - 1} + \dots + b_p x^{b_p -1}}{-(1-x^q) - qx^{q-1} (1-x)}$ \\
$\stackrel{(LH)}{=}$ & $\lim_{x \longrightarrow 1} \frac{- e_1(e_1 -1)x^{e_1-2} - \dots  - e_p(e_p -1)x^{e_p -2} - (d+1)q (q+1)x^{q-2}}{2qx^{q-1} - q(q-1)x^{q-2} (1-x)}$ \\
& $+ \frac{b_1 (b_1 -1) x^{b_1 - 2} + \dots + b_p (b_p -1) x^{b_p -2}}{2qx^{q-1} - q(q-1)x^{q-2} (1-x)}$ \\
$=$ & $\frac{-e_1(e_1 -1) - \dots - e_p(e_p -1) - (d+1)q(q-1)}{2q}$ \\
& $+\frac{b_1(b_1-1) + \dots + b_p(b_p -1)}{2q}$.
\end{tabular}
\end{center}
Note that after the first use of L'Hopital's Rule, we get a new identity:

\begin{center}  $- e_1 - \dots - e_p - q (d+1) + b_1 + \dots + b_p = 0 $ or $b_1 + \dots + b_p = e_1 + \dots + e_p + q(d+1)$.  \end{center}
Now consider all possibilities for $(d-(p-1) - (-p)) \mod p = d+1 \mod p$.

\begin{itemize}
\item  When $d + 1 \mod p \equiv 0$ then the points $(e_1, d)$ and $(b_1,-1)$ and hence also $(e_2, d -1)$ and $(b_2,-2), \dots, (e_p, d-p+1)$ and $(b_p, -p)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that
\begin{itemize}
\item[*]  $e_1 + qN = b_1$;
\item[*]  $e_2 + qN = b_2$; \\
\hspace{35pt} \vdots
\item[*]  $e_p + qN = b_p$;
\item[*]  $d + 1 - pN = 0 \Longrightarrow d = pN - 1$ or $N = \frac{d+1}{p} = \frac{\lfloor h \rfloor + 1}{p}$.
\end{itemize}
Now going back to the numerator of the rational expression for this case, we can simplify and substituting in for $d$ and $b_i$'s as follows:

\begin{tabular}{r l}
& $-e_1(e_1 -1) - \dots - e_p(e_p -1) - (d+1)q(q-1)$ \\
& $+b_1(b_1-1) + \dots + b_p(b_p -1)$ \\
$=$ & $-e_1^2 + e_1 - \dots - e_p^2 + e_p - (d+1)(q^2 - q) + b_1^2 - b_1 + \dots + b_p^2 - b_p$ \\
$=$ & $-e_1^2 + e_1 - \dots - e_p^2 + e_p - (dq^2 - dq + q^2 - q)$ \\
& $+ b_1^2 - b_1 + \dots + b_p^2 - b_p$ \\
$=$ & $-e_1^2 - \dots - e_p^2 - dq^2 + dq - q^2 + q + b_1^2 + \dots + b_p^2$ \\
& $+ (e_1 + \dots + e_p - b_1 - \dots - b_p)$ \\
$=$ & $-e_1^2 - \dots - e_p^2 - dq^2 + dq - q^2 + q + b_1^2 + \dots + b_p^2 - q(d + 1)$ \\
$=$ & $-e_1^2 - \dots - e_p^2 - dq^2 - q^2 + b_1^2 + \dots + b_p^2$ \\
$=$ & $-e_1^2 - \dots - e_p^2 - (pN-1)q^2 - q^2 + (e_1 + qN)^2 + \dots + (e_p +qN)^2$ \\
$=$ & $-e_1^2 - \dots - e_p^2 - pNq^2 + q^2 - q^2 + (e_1^2 + 2e_1qN + q^2 N^2)$ \\
& $+ \dots + (e_p^2 + 2e_pqN + q^2 N^2)$ \\
$=$ & $pq^2 N^2 - q^2 pN + 2qN(e_1 + \dots e_p)$. \\
\end{tabular} 

Recall that the denominator of the rational expression was $2q$, so we have

\begin{center}  $= \frac{pq}{2}N^2 - \frac{pq}{2}N + N(e_1 + \dots + e_p)$. \end{center}

Since $N = \frac{\lfloor h \rfloor + 1}{p}$:

\begin{tabular}{r l}
$=$ & $\frac{pq}{2}\left( \frac{\lfloor h \rfloor + 1}{p} \right)^2 - \frac{pq}{2} \left( \frac{\lfloor h \rfloor + 1}{p} \right) +\left( \frac{\lfloor h \rfloor + 1}{p} \right) (e_1 + \dots + e_p)$. \\
$=$ & $\frac{q}{2p} ( \lfloor h \rfloor^2 + 2 \lfloor h \rfloor + 1 ) - \frac{q}{2} ( \lfloor h \rfloor + 1 ) +\left( \frac{\lfloor h \rfloor + 1}{p} \right) (e_1 + \dots + e_p)$. \\ 
$=$ & $\frac{q}{2p} \lfloor h \rfloor^2 + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) \lfloor h \rfloor + \left( \frac{q}{2p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right)$ \\
$=$ & $\frac{q}{2p} (h^2 - 2h \{ h \} + \{ h \}^2) + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) (h - \{ h \})$ \\
& $+ \left( \frac{q}{2p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right)$ \\
$=$ & $\frac{q}{2p} h^2 + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} - \frac{q}{p} \{ h \} \right) h$ \\
& $+\frac{q}{2p} \{ h \}^2 - \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) \{ h \} + \frac{q}{2p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p}$ \\
$=$ & $\frac{q}{2p} h^2 + \left( \frac{e_1 + \dots + e_p}{p} + \frac{2q -pq - 2q \{ h \} }{2p} \right) h$ \\
& $+\frac{q}{2p} \{ h \}^2 - \left( \frac{2q- pq}{2p} + \frac{e_1 + \dots + e_p}{p} \right) \{ h \} + \frac{q - pq}{2p} + \frac{e_1 + \dots + e_p}{p}$
\end{tabular}

\item  When $d + 1 \mod p \equiv 1$ then the points $(e_1, d)$ and $(b_p,-p)$ and hence also $(e_2, d -1)$ and $(b_1,-1), \dots, (e_p, d-p+1)$ and $(b_{p-1}, -p+1)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that

\begin{itemize}
\item[*]  $e_1 + q(N+1) = b_p$;
\item[*]  $e_2 + qN = b_1$; \\
\hspace{35pt} \vdots
\item[*]  $e_p + qN = b_{p-1}$;
\item[*]  $d + 1 - pN = 1 \Longrightarrow d = pN$ or $N = \frac{d}{p} = \frac{\lfloor h \rfloor}{p}$.
\end{itemize}

Now by substituting back into the numerator of the rational expression above, we have 
\begin{center} 
\begin{tabular}{r l}
& $-e_1^2 - \dots - e_p^2 - (pN)q^2 - q^2 + (e_2 + qN)^2 + \dots + (e_p + qN)^2$ \\
& $+ (e_1 + q(N+1))^2$ \\
$=$ & $-e_1^2 - \dots - e_p^2 - pq^2 N - q^2 + (e_2^2 + 2e_2qN + q^2N^2)$ \\
& $+ \dots + (e_p^2 + 2e_pqN + q^2N^2) + (e_1 + 2e_1q(N+1) + q^2 (N+1)^2)$ \\
$=$ & $-pq^2 N - q^2 + 2e_2 qN + q^2 N^2 + \dots + 2e_p qN + q^2 N^2 + 2e_1q + q^2 N^2$ \\
& $+ 2q^2 N + q^2$ \\
$=$ & $pq^2 N^2 - pq^2 N + 2qN(e_1 + \dots + e_p) + 2e_1 q + 2q^2 N$.
\end{tabular}
\end{center}

Recall that the denominator of the rational expression was $2q$, so we have

\begin{center}  $= \frac{pq}{2}N^2 - \frac{pq}{2}N + N(e_1 + \dots + e_p) + e_1 + qN$. \end{center}

Since $N = \frac{\lfloor h \rfloor}{p}$:

\begin{tabular}{r l}
$=$ & $\frac{pq}{2}\left( \frac{\lfloor h \rfloor}{p} \right)^2 - \frac{pq}{2} \left( \frac{\lfloor h \rfloor}{p} \right) +\left( \frac{\lfloor h \rfloor}{p} \right) (e_1 + \dots + e_p) + e_1 + q \frac{\lfloor h \rfloor}{p}$ \\
$=$ & $\frac{q}{2p} \lfloor h \rfloor^2 - \frac{q}{2} \lfloor h \rfloor +\left( \frac{\lfloor h \rfloor}{p} \right) (e_1 + \dots + e_p) + e_1 + q \frac{\lfloor h \rfloor}{p}$ \\ 
$=$ & $\frac{q}{2p} \lfloor h \rfloor^2 + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) \lfloor h \rfloor + e_1$ \\
$=$ & $\frac{q}{2p} (h^2 - 2h \{ h \} + \{ h \}^2) + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) (h - \{ h \}) + e_1$ \\
$=$ & $\frac{q}{2p} h^2 + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} - \frac{q}{p} \{ h \} \right) h$ \\
& $+ \left( \frac{q}{2p} \{ h \}^2 - \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) \{ h \} + e_1 \right)$ \\
$=$ & $\frac{q}{2p} h^2 + \left( \frac{2q- pq - 2q \{ h \}}{2p} + \frac{e_1 + \dots + e_p}{p} \right) h$ \\
& $+ \left( \frac{q}{2p} \{ h \}^2 - \left( \frac{2q - pq}{2p} + \frac{e_1 + \dots + e_p}{p} \right) \{ h \} + e_1 \right)$ 
\end{tabular}

\item Now just consider when $(d+1) \mod p \equiv i$, where $0 \le i < p$.  Then the points $(e_1, d)$ and $(b_{p-i+1},-p+i+1), \dots, (e_i, d - i -1)$ and $(b_p,-p), (e_{i+1}, d-i)$ and $(b_1, -1) \dots$, $(e_{p-1}, d-p+2)$ and $(b_{p-i-1}, -p+i+1), (e_p, d-p+1)$ and $(b_{p-i}, -p+i)$ are cancelling each other out in our calculations.  Then there is a $N \in \mathbb{Z}_{>0}$ such that

\begin{itemize}
\item[*]  $e_1 + q(N+1) = b_{p-i+1}$; \\
\hspace{35pt} \vdots
\item[*]  $e_i + q(N+1) = b_p$;
\item[*]  $e_{i+1} + qN = b_1$; \\
\hspace{35pt} \vdots
\item[*]  $e_{p-i} + qN = b_{p-i-1}$;
\item[*]  $e_p + qN = b_{p-i}$;
\item[*]  $d + 1 - pN = i \Longrightarrow d = pN + i - 1$ or $N = \frac{d + 1 - i}{p} = \frac{\lfloor h \rfloor + 1 - i}{p}$.
\end{itemize}

Now by substituting back into the numerator of the rational expression above, we have 
\begin{center} 
\begin{tabular}{r l}
& $-e_1^2 - \dots - e_p^2 - (pN + i - 1)q^2 - q^2 + (e_{i+1} + qN)^2 + \dots$ \\
& $+ (e_p + qN)^2 + (e_1 + q(N+1))^2 + \dots + (e_i + q(N+1))^2$ \\
$=$ & $-e_1^2 - \dots - e_p^2 - pq^2 N - iq^2 + q^2 - q^2 + (e_{i+1}^2 + 2e_{i+1} qN + q^2 N^2)$ \\
& $+ \dots + (e_p^2 + 2e_p qN + q^2 N^2) + (e_1^2 + 2e_1 q(N+1) + q^2 (N+1)^2)$ \\
& $+ \dots + (e_i^2 + 2e_i q(N+1) + q^2 (N+1)^2)$ \\
$=$ & $-pq^2 N - iq^2 + 2e_{i+1} qN + q^2 N^2 + \dots + 2e_p qN + q^2 N^2 + 2e_1 qN$ \\
& $+ 2e_1 q + q^2 N^2 + 2q^2 N + q^2 + \dots + 2e_i qN + 2e_i q + q^2 N^2 + 2q^2 N + q^2$ \\
$=$ & $pq^2 N^2 - pq^2 N + 2qN(e_1 + \dots + e_p) + 2q (e_1 + \dots + e_i) + 2iq^2 N$.
\end{tabular}
\end{center}

Recall that the denominator of the rational expression was $2q$, so we have

\begin{center}  $ = \frac{pq}{2} N^2 - \frac{pq}{2} N + N(e_1 + \dots + e_p) + e_1 + \dots + e_i + iqN$.  \end{center}

Since $N = \frac{\lfloor h \rfloor + 1 - i}{p}$:

\begin{tabular}{r l}
$=$ & $\frac{pq}{2}\left( \frac{\lfloor h \rfloor + 1 - i}{p} \right)^2 - \frac{pq}{2} \left( \frac{\lfloor h \rfloor + 1 - i}{p} \right)$\\
& $+\left( \frac{\lfloor h \rfloor + 1 - i}{p} \right) (e_1 + \dots + e_p) + e_1 + \dots + e_i + iq \frac{\lfloor h \rfloor + 1 - i}{p}$. \\
$=$ & $\frac{q}{2p} ( \lfloor h \rfloor^2 + 2 \lfloor h \rfloor (1-i) + (1-i)^2 ) - \frac{q}{2} ( \lfloor h \rfloor + 1 - i )$ \\
& $+ \left( \frac{\lfloor h \rfloor + 1 - i}{p} \right) (e_1 + \dots + e_p) + e_1 + \dots + e_i + iq \frac{\lfloor h \rfloor + 1 - i}{p}$ \\ 
$=$ & $\frac{q}{2p} \lfloor h \rfloor^2 + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) \lfloor h \rfloor$ \\
& $+\frac{q(1-i)^2}{2p} - \frac{q(1-i)}{2} + \frac{(e_1 + \dots + e_p)(1-i)}{p} + e_1$ \\
& $+ \dots + e_i +iq \frac{1 - i}{p}$ \\
\end{tabular}

\begin{tabular}{r l}
$=$ & $\frac{q}{2p} (h^2 - 2h \{ h \} + \{ h \}^2) + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) (h - \{ h \})$ \\
& $+\frac{q(1-i)^2}{2p} - \frac{q(1-i)}{2} + \frac{(e_1 + \dots + e_p)(1-i)}{p} + e_1$ \\
& $+ \dots + e_i +iq \frac{1 - i}{p}$ \\
$=$ & $\frac{q}{2p} h^2 + \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} - \frac{q}{p} \{ h \} \right) h$ \\
& $+ \frac{q}{2p} \{ h \}^2 - \left( \frac{q}{p} - \frac{q}{2} + \frac{e_1 + \dots + e_p}{p} \right) \{ h \}$ \\
& $+ \frac{q(1-i)^2}{2p} - \frac{q(1-i)}{2} + \frac{(e_1 + \dots + e_p)(1-i)}{p} + e_1$ \\
& $+ \dots + e_i +iq \frac{1 - i}{p}$ \\
$=$ & $\frac{q}{2p} h^2 + \left( \frac{2q - pq - 2q \{ h \}}{2p} + \frac{e_1 + \dots + e_p}{p} \right) h$ \\
& $+ \frac{q}{2p} \{ h \}^2 - \left( \frac{2q - pq}{2p} + \frac{e_1 + \dots + e_p}{p} \right) \{ h \}$ \\
& $+ \frac{q(1-i)^2}{2p} - \frac{q(1-i)}{2} + \frac{(e_1 + \dots + e_p)(1-i)}{p} + e_1$ \\
& $+ \dots + e_i +iq \frac{1 - i}{p}$ \\
\end{tabular}
\end{itemize}

Now lets calculate the location for $e_1, e_2, \ldots, e_p$ for all the possible values for $\{ h \}$:

\begin{center}
\scalebox{0.88}{
\begin{tabular}[scale=0.8]{| c | c | c | c | c | c |}
\hline
$\{ h \}$ & $0$ & $\frac{1}{q}$ & $\frac{2}{q}$ & $ \dots$ & $\frac{q-1}{q}$  \\ \hline
$e_1$ & $1$ & $\left\lfloor  \frac{1+p}{p} \right\rfloor $ & $\left\lfloor  \frac{2+p}{p} \right\rfloor$ & $\dots$ & $\left\lfloor  \frac{q+p-1}{p} \right\rfloor $  \\ \hline
$e_2$ & $\left\lfloor  \frac{q+p}{p} \right\rfloor $ & $\left\lfloor  \frac{q+p+1}{p} \right\rfloor $ & $\left\lfloor  \frac{q+p+2}{p} \right\rfloor $ & $\dots$ & $\left\lfloor  \frac{2q+p-1}{p} \right\rfloor $  \\ \hline
$e_3$ & $\left\lfloor  \frac{2q+p}{p} \right\rfloor $ & $\left\lfloor  \frac{2q+p+1}{p} \right\rfloor $ & $\left\lfloor  \frac{2q+p+2}{p} \right\rfloor $ & $\dots$ & $\left\lfloor  \frac{3q+p-1}{p} \right\rfloor $  \\ \hline
$\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\ \hline
$e_p$ & $\left\lfloor  \frac{q(p-1)+p}{p} \right\rfloor $ & $\left\lfloor  \frac{q(p-1)+p+1}{p} \right\rfloor $ & $\left\lfloor  \frac{q(p-1)+p+2}{p} \right\rfloor $ & $\dots$ & $\left\lfloor  \frac{qp+p-1}{p} \right\rfloor $  \\ \hline
\end{tabular}}
\end{center}
Thus $e_i = \left\lfloor  \frac{q(i-1)+j}{p} + 1 \right\rfloor$, where $\frac{j}{q} = \{ h \}$ and $1 \le i \le p$.  So note that 

\begin{center}
\begin{tabular}{r c l}
$e_1 + e_2 + \dots + e_p$ & $=$ & $ \sum_{i=1}^{p} \left( \frac{q(i-1) + j}{p} + 1\right) - \sum_{i=1}^{p} \left\{ \frac{q(i-1) + j}{p} + 1\right\}$ \\
& $=$ & $ p + \sum_{i=1}^{p} \left( \frac{qi}{p} + \frac{j-q}{p}\right) - \sum_{i=1}^{p} \left\{ \frac{q(i-1) + j}{p} \right\}$ \\
& $=$ & $ p + j - q + \sum_{i=1}^{p} \left( \frac{qi}{p} \right) - \sum_{i=1}^{p} \left\{ \frac{qi + j - q}{p} \right\}$ \\
& $=$ & $ p + j - q + \frac{q}{p} \sum_{i=1}^{p} ( i ) - \sum_{i=1}^{p} \left( \frac{i}{p} \right)$ \\
& $=$ & $p + j - q + \frac{q}{p} \left(  \frac{p(p+1)}{2} \right) - \frac{1}{p} \left(  \frac{p(p-1)}{2} \right)$ \\
& $=$ & $p + j - q + \frac{q(p+1)}{2} - \frac{p-1}{2}$ \\
& $=$ & $p + j - q + \frac{q(p+1)}{2} - \frac{(p+1)-2}{2}$ \\
& $=$ & $p + j - q + 1 + \frac{(q-1)(p+1)}{2}$.
\end{tabular}
\end{center}
So going back to the results from when $(d+1) \mod p \equiv i$ and subbing this in for $e_1 + e_2 + e_3 + \dots + e_p$, then we have:

\begin{center}
\begin{tabular} { r l }
& $\frac{q}{2p} h^2 + \left( \frac{2q - pq - 2q \{ h \}}{2p} + \frac{p + j - q + 1 + \frac{(q-1)(p+1)}{2}}{p} \right) h + \frac{q}{2p} \{ h \}^2$ \\
& $- \left( \frac{2q - pq}{2p} + \frac{p + j - q + 1 + \frac{(q-1)(p+1)}{2}}{p} \right) \{ h \} + \frac{q(1-i)^2}{2p} - \frac{q(1-i)}{2}$ \\
& $+ \frac{(p + j - q + 1 + \frac{(q-1)(p+1)}{2})(1-i)}{p} + e_1 + \dots + e_i +iq \frac{1 - i}{p}$ \\
$=$ & $\frac{q}{2p} h^2 + \left( \frac{q + p + 2j - 2q \{ h \} + 1}{2p} \right) h + \frac{q}{2p} \{ h \}^2 - \left( \frac{q + p + 2j + 1}{2p} \right) \{ h \}$ \\
& $ + \frac{q(1-i)^2}{2p} - \frac{q(1-i)}{2} + \frac{(2p + 2j - 2q + 2 + 2iq + (q-1)(p+1))(1-i)}{2p}$ \\
& $+ e_1 + \dots + e_i$
\end{tabular}
\end{center}
However, we now need to find what $e_1 + e_2 + \dots + e_i$ equals, where $1 \le i < p$.  We will now do this for a couple of special cases of $<1,p,q>$.

\subsection{${\mathbf{<1,p,p+1>}}$}

Consider $<1,p,p+1>$ where $p \ge 2$.  Note that $\gcd (p, p+1) = 1$ as $1(p+1) + (-1)(p) = 1$.  Now consider $x + py + (p + 1)z = n$ and want to find a matrix $A$ such that 

\begin{center} 
$\begin{bmatrix}
1 & p & p + 1
\end{bmatrix}
\begin{bmatrix}
x \\
y \\
z
\end{bmatrix} =
\begin{bmatrix}
1 & p & p + 1
\end{bmatrix}
A
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} = n$. \end{center}
First note that $R_1 = p, R_p = 1, R_{p+1} = 1$ and lets consider $s_1 + s_2 p + s_3 (p +1) = 1$ where $s_1 = 0, s_2 = -1$ and $s_3 = 1$.  So let 

\begin{center}  $ A = \begin{bmatrix}
-p & -(p + 1) & 0 \\
1 & 0 & -1 \\
0 & 1 & 1
\end{bmatrix}$.  \end{center}
So if we have that 

\begin{center} 
$\begin{bmatrix}
1 & p & p + 1
\end{bmatrix}
 \begin{bmatrix}
-p & -(p + 1) & 0 \\
1 & 0 & -1 \\
0 & 1 & 1
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} = n$, \end{center}
then note that 

\begin{center}
\begin{tabular} {r c l}
$x = -pu - (p + 1) v$ & & $x = -pu - (p + 1)v$ \\
$y = u - w$ & or & $y = u - n$ \\
$z = v + w$ &  & $z = v + n$ \\
$w = n$ & &
\end{tabular}
\end{center}
So when 
\begin{itemize}
\item $x = 0$, then $v = - \frac{p}{p+1} u$
\item $y = 0$, then $u = n$
\item $z = 0$, then $v = -n$,
\end{itemize}
hence we have a right triangle in the $u,v$-plane with no margin, as the hypothenuse is latticial and the horizontal and vertical side have integer $y$-coordinates and integer $x$-coordinates, respectively.  Following a couple of shifts of integer length, we have Figure \ref{1pp+12D}. %\hl{Should I explain the endpoints of triangle?}

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0) -- (10,0) node [right] {$x$};
\draw [->] (0,-1) -- (0,4) node [above] {$y$};
\draw[thick] (0,0) -- (9,0) node [above right] {$\left( \frac{n}{p}, 0 \right)$};
\draw[thick] (0,0) -- (0,3) node [left] {$\left( 0, \frac{n}{p+1} \right)$};
\draw[thick] (0,3) -- (4.5,1.5) node [above right] {$y = -\frac{p}{p+1}x + \frac{n}{p+1}$};
\draw[thick] (4.5,1.5) -- (9,0);
\end{tikzpicture}
\end{center}
\caption{Transformed and Translated $<1,p,p+1>$ triangle after changing basis back to $x,y$.}
\label{1pp+12D}
\end{figure}

%Now, using Brion, we know that the number of lattice points can be found using 

%\begin{center}  
%\begin{tabular} {r l}
%& $\frac{1}{(1-x)(1-y)} + \frac{p + 1 \text{ terms}}{(1-y^{-1})(1-x^{p+1} y^{-p})} + %\frac{p \text{ terms}}{(1-x^{-1})(1-x^{-(p+1)} y^p)}$ \\
%$=$ & $\frac{(1 - x^{p+1}y^{-p})}{(1-x)(1-y)(1 - x^{p+1}y^{-p})} - \frac{y(1-x) [p + %1 \text{ terms}]}{(1-x)(1-y)(1-x^{p+1} y^{-p})}$ \\
%& $+ \frac{(1-y) (x^{p+2} y^{-p})[p \text{ terms}]}{(1-x)(1-y)(1-x^{p+1} y^{-p})}$
%\end{tabular}
%\end{center}

\newpage
\noindent{Now following the results from $<1,p,q>$, we have }

\begin{tabular}{r  l}
$=$ & $\frac{p+1}{2p} \left( \frac{n}{p+1} \right)^2 + \left( \frac{(p+1) + p + 2j - 2(p+1) \left\{ \frac{n}{p+1} \right\} + 1}{2p} \right) \left( \frac{n}{p+1} \right)$ \\
& $+ \frac{p+1}{2p} \left\{ \frac{n}{p+1} \right\}^2 - \left( \frac{(p+1) + p + 2j + 1}{2p} \right) \left\{ \frac{n}{p+1} \right\} + \frac{(p+1)(1-i)^2}{2p}$ \\
& $- \frac{(p+1)(1-i)}{2} + \frac{(2p + 2j - 2(p+1) + 2 + 2i(p+1) + p(p+1))(1-i)}{2p}$ \\
& $+ e_1 + \dots + e_i$ \\
$=$ & $\frac{n^2}{2p(p+1)} + \left( \frac{p + j - (p+1)\left\{ \frac{n}{p+1} \right\} + 1}{p(p+1)} \right)n + \frac{p+1}{2p} \left\{ \frac{n}{p+1} \right\}^2$ \\
& $- \left( \frac{p + j + 1}{p} \right) \left\{ \frac{n}{p+1} \right\} + \frac{(p+1)(1-i)^2}{2p} - \frac{(p+1)(1-i)}{2}$ \\
& $+ \frac{(p^2 + p + 2ip + 2i + 2j)(1-i)}{2p} + e_1 + \dots + e_i$ \\

\end{tabular}

%\begin{center}  $\frac{p+1}{2p} \left\lfloor \frac{n}{p+1} \right\rfloor^2 + \left( \frac{p+1}{p} - \frac{p+1}{2} + \frac{e_1 + \dots + e_p}{p}\right) \left \lfloor \frac{n}{p+1} \right \rfloor + \frac{p+1}{2p} + e_1 + \dots + e_i + \frac{1-i}{p} (e_1 + \dots + e_p) - \frac{i^2 (p+1)}{2p} - \frac{p+1}{2} + \frac{(p+1)i}{2}$.  \end{center}
%Writing this expression in terms of $n$, we have
%\begin{center}  $\frac{n^2}{2p(p+1)} + \left( \frac{1}{p} - \frac{1}{2} + \frac{e_1 + \dots + e_p}{p(p+1)} - \frac{1}{p} \left \{ \frac{n}{p+1} \right \} \right) n + \frac{p+1}{2p} + e_1 + \dots + e_i + \frac{1-i}{p} (e_1 + \dots + e_p) - \frac{i^2(p+1)}{2p} - \frac{p+1}{2} + \frac{(p+1)i}{2} + \left( \frac{p+1}{p} - \frac{p+1}{2} + \frac{e_1 + \dots + e_p}{p} \right) \left \{ \frac{n}{p+1} \right \} + \frac{p+1}{2p} \left \{ \frac{n}{p+1} \right \}^2$. \end{center}

Now we need to determine what $\sum_{j=1}^i e_j$ equals, where $i \in \{1,2,\ldots, p \}$.  This is determined by $\left \{ \frac{n}{p+1} \right \}$:
\begin{itemize}
\item  When $\left \{ \frac{n}{p+1} \right \} = 0$, then $\sum_{l=1}^i e_l = 1 + 2 + \dots + i = \frac{i(i+1)}{2}$
\item  When $\left \{ \frac{n}{p+1} \right \} = \frac{1}{p+1}$, then
\begin{center} $\sum_{l=1}^i e_l = \begin{cases} 
      1+2+\dots+i = \frac{i(i+1)}{2} & \text{for } 1 \le i \le p-1 \\
      (1+2+\dots+p)+1 = \frac{p(p+1)}{2} + 1 & \text{for } i = p
   \end{cases}$ \\
$\vdots$ \\
$\vdots$ 
\end{center}
\item  When $\left \{ \frac{n}{p+1} \right \} = \frac{r}{p+1}$ where $r \in \{ 0, 1, 2, \ldots, p \}$, then 
\begin{center} $\sum_{l=1}^i e_l = \begin{cases} 
      1+2+\dots+i = \frac{i(i+1)}{2}; & 1 \le i \le p-r \\
      (1+2+\dots+i) + (i - (p-r)) = \frac{i(i+1)}{2} + i + r -p; & p-r < i \le p
   \end{cases}$
\end{center}
\end{itemize}

%\noindent{Thus if we let $\beta_i = \sum_{j=1}^i e_j$, then we have that}

%\begin{center}  
%\begin{tabular}{r c l}
%$f(n)$ & $=$ & $\frac{n^2}{2p(p+1)} + \left( \frac{p + j - (p+1)\left\{ \frac{n}{p+1} \right\} + 1}{p(p+1)} \right)n + \frac{p+1}{2p} \left\{ \frac{n}{p+1} \right\}^2$ \\
%& & $- \left( \frac{p + j + 1}{p} \right) \left\{ \frac{n}{p+1} \right\} + %\frac{(p+1)(1-i)^2}{2p} - \frac{(p+1)(1-i)}{2}$ \\
%& & $+ \frac{(p^2 + p + 2ip + 2i + 2j)(1-i)}{2p} + e_1 + \dots + e_i$ \\
%\end{tabular}
%\end{center}

%Now lets try to count the number of lattice points in this right triangle.  When $z \in \mathbb{Z} \cap \left[ 0, \frac{n}{p} \right]$, then we can find the corresponding $y$-coordinate:  when $x = i$, then $y = \frac{n-ip}{p+1}$.  Further, let $\left \{ \frac{n}{p+1} \right \} = \frac{r}{p+1}$, where $0 \le r \le p$, then we have:

%\begin{center}
%\begin{tabular} {r c c c l}
%$x = 0$ & , & $y$ & $=$ & $\left \lfloor \frac{n}{p+1}  \right \rfloor + \frac{r}{p+1}$ \\
%$x = 1$ & , & $y$ & $=$ & $\left \lfloor \frac{n-p}{p+1}  \right \rfloor + \frac{r+1}{p+1}$ \\
%& \vdots & \\
%$x = j$ & , & $y$ & $=$ & $\left \lfloor \frac{n-jp}{p+1}  \right \rfloor + 0$, where $r + j = p+1$ or $j = p - r + 1$ \\
%$x = j+1$ & , & $y$ & $=$ & $\left \lfloor \frac{n-(j+1)p}{p+1}  \right \rfloor + \frac{1}{p+1}$ \\
%& \vdots & \\
%$x = i$ & , & $y$ & $=$ & $\left \lfloor \frac{n-ip}{p+1}  \right \rfloor + \frac{i-j}{p+1} = \left \lfloor \frac{n-ip}{p+1}  \right \rfloor + \frac{i-(p-r+1)}{p+1}$ \\
%& & & $=$ & $\left \lfloor \frac{n-ip}{p+1}  \right \rfloor + \frac{i+r}{p+1} - 1$. \\
%\end{tabular}
%\end{center}

%Now we can directly count the number of lattice points in this triangle:

%\begin{center}
%\begin{tabular}{r l}
%& $\left( \left \lfloor \frac{n}{p+1}  \right \rfloor + 1 \right) + \dots + \left( \left \lfloor \frac{n}{p+1}  \right \rfloor + 1 - (j-1) \right) + \left( \left \lfloor \frac{n}{p+1}  \right \rfloor + 1 - j + 1 \right) + \dots$ \\
%$=$ & $\left \lfloor \frac{n}{p} \right \rfloor \left( \left \lfloor \frac{n}{p+1}  \right \rfloor + 1 \right) - \sum_{i = 0}^{\left \lfloor \frac{n}{p} \right \rfloor} i +  \sum_{i = 0}^{\left \lfloor \frac{n}{p} \right \rfloor} \left \lfloor \frac{i+r}{p+1} \right \rfloor$ \\
%$=$ & $\left( \frac{n}{p} - \left\{ \frac{n}{p} \right\} \right) \left( \frac{n}{p+1} - \frac{r}{p+1} + 1 \right) - \frac{\left \lfloor \frac{n}{p} \right \rfloor \left( \left \lfloor \frac{n}{p} \right \rfloor + 1\right)}{2} + \sum_{i = p+1-r}^{\left \lfloor \frac{n}{p} \right \rfloor} \left \lfloor \frac{i+r}{p+1} \right \rfloor$ \\
%$=$ & $\left( \frac{n}{p} - \left\{ \frac{n}{p} \right\} \right) \left( \frac{n}{p+1} - \frac{r}{p+1} + 1 \right) - \frac{\left( \frac{n}{p} - \left \{ \frac{n}{p} \right \} \right)\left( \frac{n}{p} - \left \{ \frac{n}{p} \right \} + 1 \right)}{2}$ \\
%& $+ (p + 1)\sum_{i = i}^{\alpha} i + \left( \lfloor \alpha \rfloor + 1 \right) \left( \left \lfloor \frac{n}{p} \right \rfloor - (p + 1 - r + (p + 1) \alpha) \right)$ \\
%\end{tabular}
%\end{center}

%where $\alpha = \left \lfloor \frac{\left \lfloor \frac{n}{p} \right \rfloor - (p+1-r)}{p + 1} \right \rfloor$.

\subsection{${\mathbf{<1,p,kp+1>}}$}

\begin{rem}
When considering the monoid $<1,p,kp+1>$ where $p \ge 2$, there will be many similarities as the monoid we considered in the previous section.  The key to the similarities will be that $kp+1 \mod p \equiv 1$, for any $k \in \mathbb{Z}_{>0}$.
\end{rem}

Consider $<1,p,kp+1>$ where $p \ge 2$.  Note that $\gcd (p, kp+1) = 1$ as $1(kp+1) + (-k)(p) = 1$.  Now consider $x + py + (kp + 1)z = n$ and want to find a matrix $A$ such that 

\begin{center} 
$\begin{bmatrix}
1 & p & kp + 1
\end{bmatrix}
\begin{bmatrix}
x \\
y \\
z
\end{bmatrix} =
\begin{bmatrix}
1 & p & kp + 1
\end{bmatrix}
A
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} = n$. \end{center}
First note that $R_1 = p, R_p = 1, R_{kp+1} = 1$ and lets consider $s_1 + s_2 p + s_3 (p +1) = 1$ where $s_1 = 0, s_2 = -k$ and $s_3 = 1$.  So let 

\begin{center}  $ A = \begin{bmatrix}
-p & -(kp + 1) & 0 \\
1 & 0 & -k \\
0 & 1 & 1
\end{bmatrix}$.  \end{center}
So if we have that 

\begin{center} 
$\begin{bmatrix}
1 & p & kp + 1
\end{bmatrix}
 \begin{bmatrix}
-p & -(kp + 1) & 0 \\
1 & 0 & -k \\
0 & 1 & 1
\end{bmatrix}
\begin{bmatrix}
u \\
v \\
w
\end{bmatrix} = n$, \end{center}
then note that 

\begin{center}
\begin{tabular} {r c l}
$x = -pu - (kp + 1) v$ & & $x = -pu - (kp + 1)v$ \\
$y = u - kw$ & or & $y = u - kn$ \\
$z = v + w$ &  & $z = v + n$ \\
$w = n$ & &
\end{tabular}
\end{center}
So when 
\begin{itemize}
\item $x = 0$, then $v = - \frac{p}{kp+1} u$
\item $y = 0$, then $u = kn$
\item $z = 0$, then $v = -n$,
\end{itemize}
hence we have a right triangle in the $u,v$-plane with no margin, as the hypothenuse is latticial and the horizontal and vertical side have integer $y$-coordinates and integer $x$-coordinates, respectively.  Following a couple of shifts of integer length, we have Figure \ref{1pkp+12D}.

\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw [->] (-1,0) -- (10,0) node [right] {$x$};
\draw [->] (0,-1) -- (0,4) node [above] {$y$};
\draw[thick] (0,0) -- (9,0) node [above right] {$\left( \frac{n}{p}, 0 \right)$};
\draw[thick] (0,0) -- (0,3) node [left] {$\left( 0, \frac{n}{kp+1} \right)$};
\draw[thick] (0,3) -- (4.5,1.5) node [above right] {$y = -\frac{p}{kp+1}x + \frac{n}{kp+1}$};
\draw[thick] (4.5,1.5) -- (9,0);
\end{tikzpicture}
\end{center}
\caption{Transformed and Translated $<1,p,kp+1>$ triangle after changing basis back to $x,y$.}
\label{1pkp+12D}
\end{figure}

\noindent{Now following the results from $<1,p,q>$, we have }

$$= \frac{kp+1}{2p} \left( \frac{n}{kp+1} \right)^2 + \left( \frac{(kp+1) + p + 2j - 2(kp+1) \left\{ \frac{n}{kp+1} \right\} + 1}{2p} \right) \left( \frac{n}{kp+1} \right)$$
$$+ \frac{kp+1}{2p} \left\{ \frac{n}{kp+1} \right\}^2 - \left( \frac{(kp+1) + p + 2j + 1}{2p} \right) \left\{ \frac{n}{kp+1} \right\} + \frac{(kp+1)(1-i)^2}{2p}$$
$$- \frac{(kp+1)(1-i)}{2} + \frac{(2p + 2j - 2(kp+1) + 2 + 2i(kp+1) + kp(p+1))(1-i)}{2p}$$
$$+ e_1 + \dots + e_i$$
$$=\frac{n^2}{2p(kp+1)} + \left( \frac{(k+1)p + 2j - 2(kp+1) \left\{ \frac{n}{kp+1} \right\} + 2}{2p(kp+1)} \right) n + \frac{kp+1}{2p} \left\{ \frac{n}{kp+1} \right\}^2$$ 
$$- \left( \frac{(k+1)p + 2j + 2}{2p} \right) \left\{ \frac{n}{kp+1} \right\} + \frac{(kp+1)(1-i)^2}{2p} - \frac{(kp+1)(1-i)}{2}$$
$$+ \frac{(kp^2 + 2p + 2j - kp + 2kpi + 2i)(1-i)}{2p} + e_1 + \dots + e_i$$

Now we need to determine what $\sum_{j=1}^i e_j$ equals, where $i \in \{1,2,\ldots, p \}$.  This is determined by $\left \{ \frac{n}{p+1} \right \}$:
\begin{itemize}
\item  When $\left \{ \frac{n}{p+1} \right \} = 0$, then $\sum_{j=1}^i e_j = 1 + (k+1) + (2k+1) \dots + ((i-1)k+1) = k \frac{i(i-1)}{2} + i$
\item  When $\left \{ \frac{n}{p+1} \right \} = \frac{1}{p+1}$, then \\
$\sum_{j=1}^i e_j = \\ \begin{cases} 
      1 + (k+1) + \dots + ((i-1)k+1) = k \frac{i(i-1)}{2} + i; & 1 \le i < p \\
      1 + (k+1) + \dots + ((p-1)k+1) + 1 = k \frac{p(p-1)}{2} + p + 1; & i = p
   \end{cases}$ \\
$\vdots$ \\
$\vdots$ 
\item  When $\left \{ \frac{n}{kp+1} \right \} = \frac{r}{kp+1}$ where $r \in \{ 0, 1, 2, \ldots, kp \}$, then \\
$\sum_{j=1}^i e_j = \begin{cases} 
      k \frac{i(i-1)}{2} + i & \text{for } 1 \le i \le kp-r \\
      k\frac{i(i-1)}{2} + i + r -p & \text{for } kp-r+1 \le i \le kp
   \end{cases}$
\end{itemize}







%\section{Lengths, Margins, Slopes}

%\begin{ex}

%$R_a a = R_b b \not= R_c c$ $\longleftrightarrow$ isosceles triangle

%\end{ex}

%\begin{conj}[**Possible**]

%$\exists 3$ $0$'s in the Johnson Matrix $\longleftrightarrow$ right triangle.

%\end{conj}

%What about when $R_a a = R_b b \not= R_c c$?? $\longleftrightarrow$ ??

\newpage

%Finally note that even though our examples has been in dimensions $1$ and $2$ with integer endpoints/vertices, Brion's Theorem is true for any dimension as long as the vertices are rational.

\newpage

\chapter{Conclusions and Future Work}

The novel contributions of this thesis to the literature are:

\begin{enumerate}
\item  The secondary asymptotic of the Enumeration Problem for arbitrary $3$ generator numerical monoids. (Section 5.3)
\item  The complete solution of the Enumeration Problem for $3$ generator numerical monoids of the third kind ($R_a a = R_b b = R_c c$). (Section 6.2.1)
\item  The complete solution of the Enumeration Problem for the McNugget Monoid ($M = <6,9,20>$). (Section 6.2.2)
\item  The complete solution of the Enumeration Problem for a couple of infinite families outside the cases mentioned above ($<1,p,p+1>$ and $<1,p,kp+1>$). (Section 6.3.2 and 6.3.3)
\end{enumerate}

Another novel aspect of our approach is the geometric techniques employed, for instance, the Johnson Transformation (named after Selmer Johnson because of its connection to the Johnson Equations), which was not previously available in the literature. \\

The ultimate goal of an effectively computable formula with a bounded number of terms for $f_M (n)$ when $M$ is a numerical monoid with 3 generators for the cases II and III seems very difficult.  It may not even be possible.  If possible, clearly it will be quite complicated (based on the examples worked out in this thesis).  For 3 generators what is missing is the (periodic) constant term of the quadratic quasi-polynomial $f_M (n)$. \\

However, for a general polygon, $P$, based on the second asymptote found for the Frobenius Problem, we believe that the second asymptote is given by the following expression:

\begin{center}
\begin{tabular}{r c l}
$f(n)$ & $=$ & Area $n^2 + \left( \frac{1}{2} \mu_{\mathbb{Z}}^1 ( \partial P ) - \sum_{\text{e:edge}} m_e \mu_{\mathbb{Z}}^1 (e) \right) n + $ periodic function \\
& $=$ & Area $n^2 + \left( \sum_{\text{e:edge}} \left( \frac{1}{2} - m_e \right) \mu _{\mathbb{Z}}^1 (e) \right) n  -\frac{3}{2} + $ periodic function
\end{tabular}
\end{center}

\noindent{Similarly, for a general $d$-dimensional polytope, we believe that the second asymptotic is also given in the follow expression:}

\begin{center}
\begin{tabular}{r c l}
$f(n) = |nP|$ & $=$ & $\mu_{\mathbb{Z}}^d (P) n^d + \left( \sum_{\text{f:facets}} \left( \frac{1}{2} - m_f \right) \mu_{\mathbb{Z}}^{d-1} (f) \right) n^{d-1} + \dots$.
\end{tabular}
\end{center}

\begin{thebibliography}{9}

\bibitem{AssiGar}
A. Assi, P. A. Garcia-Sanchez. \textit{Numerical Semigroups and Applications}, RSME Springer series {\bf{1}}, Springer (2016).

\bibitem{Bar94}
A. Barvinok. \textit{A polynomial time algorithm for counting integral points in polyhedra when the dimension is fixed}, Math. Oper. Res. 19 (1994), 769-779.

\bibitem{SumCon1}
A. Barvinok et al Editors. AMS-IMS-SIAM Joint Summer Research Conference on Integer Points in Polyhedra: Proceedings of an AMS-IMS-SIAM Joint Summer Research Conference on Integer Points in Polyhedra, July 13-17, 2003, Snowbird, Utah /  2005.

\bibitem{BarICM}
A. Barvinok, \textit{The complexity of generating functions for integer points in polyhedra and beyond, International Congress of Mathematicians. Vol. III}, European Mathematical Society, Z{\"u}rich, 2006, pp. 763-787

\bibitem{Bar08}
A. Barvinok. \textit{Integer Points In Polyhedra}. Zurich: European Mathematical Society, 2008.

\bibitem{SumCon2}
M. Beck et al Editors. AMS-IMS-SIAM Joint Summer Research Conference Integer Points in Polyhedra: AMS-IMS-SIAM Joint Summer Research Conference, June 11-15, 2006, Snowbird, Utah  2008.

\bibitem {BHS}
M. Beck, C. Haase, F. Sottile. \textit{Formulas of Brion, Lawrence, and Varchenko on Rational Generating Functions for Cones}. The Mathematical Intelligencer. $\mathbf{31}$ $\mathbf{1}$ ($2009$), 9-17.

\bibitem{BR07}
M. Beck, S. Robins.  \textit{Computing the Continuous Discretely: Integer Point Enumeration in Polyhedra}. Springer, 2007.

\bibitem{BV07}
N. Berline, M. Vergne.  \textit{Local euler-maclaurin formula for polytopes.}  Moscow Mathematical Journal, 7:355-386, 2007.

\bibitem{BourSin07}
J. Bourgain, Y. Sinai. \textit{Limit Behaviour of Large Frobenius Numbers}. Russian Mathematical Surveys, vol. 62, no. 4, 2007, pp. 713-725.

\bibitem{Den03}
G. Denham. \textit{Short generating functions for some semigroup algebras,} Electron. J. Combin. 10 (2003), \#R36, 7 pp. (electronic)

\bibitem{John60}
S. M. Johnson. \textit{A linear diophantine problem}, Canad. J. Math., 12 (1960), no. 2, 390-398.

\bibitem{NL10}
N. Lauritzen. \textit{Lectures on Convex Sets}, at Aarhus University, March 2010, https://www.fmf.uni-lj.si/~lavric/lauritzen.pdf

\bibitem{Leher}
E. Leher. \textit{The Coin Exchange Problem}, VDM Publishing (2009)

\bibitem{JM10}
J. Marklof. \textit{The Asymptotic Distribution of Frobenius Numbers}. Inventiones Mathematicae, vol. 181, no. 1, 2010, pp. 179?207.

\bibitem{BarPop}
T. Popoviciu.  \textit{Asupra unei probleme de patitie a numerelr.}  Acad. Republicii Populare Romane, Filiala Cluj, Studii si cercetari stiintifice, 4:7-58, 1953

\bibitem{RamAlf}
J.L. Ramirez. \textit{The Diophantine Frobenius problem}, Oxford Lect. Ser. in Math. and its Appl. 30, Oxford Univ. Press, 2005

\bibitem{Ros96}
J. C. Rosales, P. A. Garcia-Sanchez. \textit{Numerical Semigroups}, Springer, Berlin, 2009.

\bibitem{SS98}
S. Sert{\"o}z. \textit{On the number of solutions of the Diophantine equation of Frobenius.} Diskret. Mat., 10(2):62-71, 1998.

\bibitem{Sylvester}  
J.J. Sylvester. \textit{On Subvariants, I.e. Semi-Invariants to Binary Quantics of an Unlimited Order}. American Journal of Mathematics, vol. $5$, no. $1$, $1882$, pp. $79 - 136$. JSTOR, www.jstor.org/stable/2369536.

\bibitem{HT74}
H. Tverberg. \textit{How to cut a convex polytope into simplices.} Geometriae Dedicata, 3:239-240, 1974.

\end{thebibliography}

\end{document}