Express $A \cup B$ in set buildier notation when $A=\{2n+1 \mid n \in \mathbb{Z}\}$ and $B=\{3n+2 \mid n \in \mathbb{Z}\}$ Express $A \cup B$ in set buildier notation when $A=\{2n+1 \mid n \in \mathbb{Z}\}$ and $B=\{3n+2 |n \in \mathbb{Z}\}$
We know that the rooster notation version of the union set is $A \cup B = \{1,2,3,5,7,8,9,11,13,14,15,17,19,20,21,\ldots\}$
It is a combination of every odd integer and every multiple of $6$ added with $2$. The even values in $A \cup B$ will be produced by the even inputs to the set $B$.
I haven't been able to find a sequence definition in terms of $n$ for the set builder notation version of $A \cup B$
NOTE: the mod operator is not allowed in the computation of the sequence, I come from a CS background, that was my first idea, but it's not valid for the rules of the game, sadly.
 A: The sequence is such that $$A \cup B = \{1,2,3,5,6+1,\dots,6+5,\dots,n \cdot 6 + 1, \dots, n\cdot 6 + 5,\dots\}$$ therefore we could express it such as  $$ A \cup B = \{n\ \vert\ n = 1,2,3,5 \mod 6\}$$ I'm not sure whether you can express it in a closed form though.
A: Write the elements of $A$ as $a_n$, the elements of $B$ as $b_n$, and the elements of $C\equiv A\cup B$ as $c_n$. In other words, $a_n = 2n+1$, $b_n=3n+2$, and you want a formula for $c_n$ (there is, of course, not a unique answer since the elements are not ordered, and may be repeated without changing $C$).
I suggest you use (say) even integers to index the $a_n$ and odd integers to index the $b_n$. Then you can alternate between them, using the fact that
$$f_n\equiv \frac{1+(-1)^n}2$$ is $1$ for even $n$ and $0$ for odd $n$, while
$$g_n\equiv \frac{1-(-1)^n}2$$ is $0$ for even $n$ and $1$ for odd $n$. This means you can put
$$c_n = f_na_{\lfloor n/2\rfloor} + g_nb_{\lfloor(n-1)/2 \rfloor}
$$(here, "$\lfloor\cdot\rfloor$" denotes the "floor" or "greatest integer" function).
Let's test a few values:
$c_0 = f_0a_0+g_0b_{-1} = 1\cdot a_0 + 0\cdot b_{-1} = a_0$
$c_1 = f_1a_0+g_0b_0 = 0\cdot a_0 + 1\cdot b_0 = b_0$
$c_2 = f_2a_1+g_2b_0 = 1\cdot a_1 + 0\cdot b_0 = a_1$
$c_3 = f_3a_1+g_3b_1 = 0\cdot a_1 + 1\cdot b_1 = b_1$
$c_4 = f_4a_2+g_4b_1 = 1\cdot a_2 + 0\cdot b_1 = a_2$
$c_5 = f_5a_2+g_5b_2 = 0\cdot a_2 + 1\cdot b_2 = b_2$
and so on. The explicit formula, using your definitions of $a_n$ and $b_n$, would be
$$\boxed{c_n = \left( \frac{1+(-1)^n}2 \right)\left(2\lfloor n/2\rfloor + 1\right) + \left( \frac{1-(-1)^n}2 \right)\left(3\lfloor(n-1)/2 \rfloor+2\right)}
$$
and your set in set-builder notation would be
$$\boxed{C=\left\{ \left( \frac{1+(-1)^n}2 \right)\left(2\lfloor n/2\rfloor + 1\right) + \left( \frac{1-(-1)^n}2 \right)\left(3\lfloor(n-1)/2 \rfloor+2\right):n\in\mathbb Z\right\}}$$
