This question is concerned only with natural numbers. Assume you have a set $x=[0,1,2,3,4,…,n]$ for an arbitrary limit $n$ or $m$ (such that the cardinality is the same) which maps to $y=[1,2,3,4,…,m]$. Then a function that does the mapping is obviously $y=f(x)=x+1$. If you change $y$ so it only has odd numbers, i.e. $x=[1,3,5,7,…n]$ then the function would be $y=f(x)=2x+1$. What would be function that skips multiples of 2 and 3, i.e. $x=[0,1,2,3,4,…,n]$ and $y=[1,5,7,11,13,17,19,23,25,…,m]$ ?
What function would map the set of natural numbers to the set of natural numbers excluding multiples of 2 and 3
discrete mathematicselementary-number-theoryelementary-set-theory
Related Question
- [Math] Is the Cauchy sequence of natural numbers countable
- After deleting the multiples of $2$ and multiples of $3$ from list of integers from $1$ to $N$, why are a fifth of the numbers still multiples of 5
- Continuous function that outputs even and odd numbers from natural inputs in a non-constant, non-alternating order
- Does a function exist that maps the natural numbers to the natural numbers excluding multiples of 2 and 3 and starting at an arbitrary point
Best Answer
Note that set $y$ can be written as
$$y=\{6(0)+1,6(1)-1,6(1)+1,6(2)-1,6(2)+1,6(3)-1,6(3)+1,...\}$$
So first we need a function that maps $\{0,1,2,3,4,5,6,...\} \to \{0,1,1,2,2,3,3,...\}$; that could be either
$$\left \lfloor \dfrac{x+1}{2} \right \rfloor \quad \text{or} \quad \left \lceil \dfrac{x}{2} \right \rceil$$
Next we need a function that maps $\{0,1,2,3,4,5,6,...\} \to \{1,-1,1,-1,1,-1,1,...\}$; that would be
$$(-1)^n$$
Thus the required function (at least two versions of it) could be
$$y=6\left \lfloor \dfrac{x+1}{2} \right \rfloor + (-1)^x \qquad \text{or} \qquad 6\left \lceil \dfrac{x}{2} \right \rceil + (-1)^x$$