This question is a generalization of this other question. To recap, I was looking for a function that mapped the set of natural numbers to the set of natural numbers excluding multiples of 2 or 3 or both. So a function $f: x mapsto y$ where $x = {0, 1, 2, 3,…,m}$ and $y={1,5,7,11,13,17,…,n}$ for some arbitrary limit $m$. @A.J. gave a great solution

$y=qquad 6left lceil dfrac{x}{2} right rceil + (-1)^x$

Now I’m wondering about a generalization that allows for the set $y$ to start at an arbitrary point (that is not a multiple of 2 nor 3). For example instead of $x=0$ mapping to $y=1$ it would instead map to $y=5$ and the formula would then be $y=6left lceil dfrac{x+3}{2} right rceil + (-1)^{x+3}$ in other words translated 3 units. Or if we wanted $x=0$ to may to $y=41$ then it would be $y=6left lceil dfrac{x+13}{2} right rceil + (-1)^{x+13}$. But I only know this because I precomputed the set starting at 1 and translated the number per the number of skipped members. If the number is bigger this would be non-trivial. For example, $101$ is not a multiple of 2 nor 3 so what function would start with $x=0$ mapping to $y=101$ and then continue by skipping multiples of 2 and 3 e.g. $103, 107, 109$.

Is there a generalization for a function that given the “starting point” $a$ that is not a multiple of 2 nor 3, and the parameter $x$, it maps $x={0,1,2,3,…,m}$ to $y$ where each member of $y$ is $ge$ $a$ and each subsequent term is the next non-multiple of 2 nor 3?