Inverse of a function containing $(-1)^n$

76 Views Asked by At

Is it possible to find the inverse of a function which contains the term $(-1)^n$?

Specifically: I want to find the inverse of the following function, which gives the nth number of the form $6k\pm1$: $$ f(n) = 3n + \frac{3}{2} - \frac{(-1)^n}{2} $$

Since it is not possible to take the log to base -1 and I'm not a mathematician, I didn't suceed with my attempts of solving for $f(n)$. (Google search and Wolfram Alpha didn't help either, and based on the fact that $(-1)^n$ "looses" information about n I doubt it's possible in general)

2

There are 2 best solutions below

2
On BEST ANSWER

For $n$ even we have $$f(n)=3n+1$$ and you can write $$\frac{f(n)-1}{3}=n$$ If $n$ is odd then you will get $$f(n)=3n+2$$ so $$n=\frac{f(n)-2}{3}$$

0
On

Consider the equation $f(n)=m$:

  • if $n=2k$, you get the equation $6k+1=m$, whose solution is $k=\frac{m-1}6\left(\iff n=\frac{m-1}3\right)$;
  • if $n=2k-1$, you get the equation $6k-1=m$, whose solution is $k=\frac{m+1}6\left(\iff n=\frac{m+1}3\right)$.

So, the inverse that you're looking for is$$n\mapsto\frac{n-(-1)^n}3.$$