Creating a set-builder notation with alternating negative and positive numbers

discrete mathematicsnotation

I'm working on a problem:
"Convert the given set into a set in set-builder notation: $B = \{2, -5, 8, -11, 14, …\}$."

I found that for the pattern of number changing is going up by $3$ and alternating between negative and positive integers. Negative when $x$ is odd and positive when $x$ is even.

I've made this set-builder notation below for the changing by $3$.

$$\{x ∈ \mathbb Z | x\%3 – 2 = 0\}$$

What can I modify in the above set-builder notation to work with the alternating between positive and negative aspect.

Best Answer

I am not sure what is your definition of "set-builder notation".

The set written by Kman3 is the correct set, although I would probably write it $$\{(-1)^{x-1}(3x-1)\}_{x \in \mathbb{N}},$$

where $\mathbb{N}$ denotes $\{1,2,3,\dots\}$. Alternatively, if you want to stick with the modulo point of view in the set of all integers:

$$\{x \in \mathbb{Z}\ | \ x>0,\,x\%6=2\}\,\cup\{x \in \mathbb{Z}\ | \ x<0,\,x\%6=1\}.$$

Or without the percent sign notation:

$$\{x \in \mathbb{Z}\ | \ x>0,\,\,x \equiv 2 \pmod{6}\}\,\,\cup\,\,\{x \in \mathbb{Z}\ | \ x<0,\,\,x \equiv 1 \pmod{6}\}.$$

Edit:

If you don't want the union there ($\cup$), we can write:

$$\{x \in \mathbb{Z}\ : \ |x| \equiv 2 \pmod{3},\quad\,x \equiv 1 \,\text{or}\,2 \pmod{6}\}$$

$$=\,\,\{x \in \mathbb{Z}\ : \ |x|\%3=2,\quad x\%6\in\{1,2\}\}.$$

Related Question