Exclude one function from another

23 Views Asked by At

Is it possible to find a function, $g(n)$ that will include all the natural values except those in $f(n)$?

$$f(n) = 3n$$

$$g(n) = 1,2,4,5,7,8,10...$$

1

There are 1 best solutions below

3
On BEST ANSWER

The function exists, but I guess that what you want is an expression.

$$g(n)=3\left\lfloor\frac {n-1}2\right\rfloor+2-2\left(\frac n2-\left\lfloor\frac n2\right\rfloor\right)$$