Let $p$ be an odd prime, and $a$ be an element of field $\Bbb Z_p$.
Define $l$ as the Legendre symbol $\displaystyle\biggl(\frac ap\biggr)$.
When $l=+1$, define $b$ as a particular solution of $b^2=a$ in $\Bbb Z_p$, e.g. the odd one in range $[1,p)$.
Define the set $\mathcal S$ as: $$\mathcal S=\begin{cases} \{\infty\}\cup\Bbb Z_p&\text{when }l=-1\\ \{\infty\}\cup\Bbb Z_p-\{0\}&\text{when }l=0\\ \{\infty\}\cup\Bbb Z_p-\{b,\,p-b\}&\text{when }l=+1 \end{cases}$$
Define internal law $\boxplus$ in $\mathcal S$ as: $$x\boxplus y=\begin{cases} y&\text{when }x=\infty\\ x&\text{when }x\ne\infty\text{ and }y=\infty\\ \infty&\text{when }x\ne\infty\text{ and }y=-x\\ (x+y)^{-1}(x\,y+a)&\text{(computed in $\Bbb Z_p$) otherwise} \end{cases}$$
$(S,\boxplus)$ is a finite Abelian group¹ of order $p-l$. What's its name in standard literature?
¹ The Abelian group axioms hold:
- Closure of $\boxplus$ follows from definitions, trivially for the case $l=-1$, and with some level of care in the other ones.
- The neutral is $\infty$. This follows from the first three cases of the definition of $\boxplus$.
- The opposite $-x$ is computed as in $\Bbb Z_p$ when $x\ne\infty$, and we define $-\infty$ as $\infty$. That $x\boxplus(-x)=\infty=(-x)\boxplus x$ follows from the first and third cases of the definition.
Associativity $(x\boxplus y)\boxplus z=x\boxplus(y\boxplus z)$ needs to be proved in multiple cases:
- When any of $x$, $y$ or $z$ is $\infty$, we use the first two cases of the definition.
- Otherwise, when $y$ is $-x$ or $-z$, we use the first three cases of the definition.
- In the remaining general case, it boils down to basic algebra. The exclusions in the definition of $\mathcal S$ prevent degenerate cases.
- Commutativity is easy.