Let's say we want to construct a non-UFD that is a commutative ring that satisfies:
There exists $a$ such that there exists a set $X$ of elements of finite cardinality $k$ such that for any $x,y \in X, x \neq y$, $xy$ is not divisible by $a^2$ but $x \cdot x$ is divisble by $a^2$ for $\forall x \in X$
Question is, first of all, can such example exist for every finite cardinality $k$?
Secondly, if the first question is affirmative, can anyone show how to construct such ring without involving monomials or polynomials? (So basically numerical one)