Does this function have a complement on the positive integers in the sense that the range of the complement should be the complement of the range of the function?
$$\frac{1}{8} \left(1-(-1)^n+2 n (2+n)\right)$$
Here is the inverse/complement which I got from Generic Human:
$$\left\lfloor \sqrt{4 n-1}\right\rfloor +n+1$$
Edit per @robjohn:
Domain is $\mathbb{N}$. I'm trying to use the Lambek-Moser theorem to generate complimentary sets.
The formula generates the pronic numbers interleaved with the squares. $\{1,2,4,6,9,12,16,20,25,30\}$
I want to generate the complementary set of everything else.
$\{3,5,7,8,10,11,13,14,15,17\}$
The Lambek-Moser theorem uses the inverse to generate the complement.
My question is: am I interpreting this scenario properly?
Note: If all you care about is existence of such a function, then the Lambek-Moser theorem guarantees the existence of such a function simply because $F$ is increasing. But if you want a nice closed-form expression, then Lambek-Moser doesn't tell you that it exists, it can just help you find it.
In the context of the Lambek-Moser theorem, you have the increasing function from $\mathbb N^*\to\mathbb N^*$: $$F(2k)=k(k+1)\\ F(2k+1)=(k+1)^2$$ Define $f(n)=F(n)-n$, which happens to coincide with $F(n-2)$: $$f(2k)=k(k-1)\\ f(2k+1)=(k-1)^2$$ Since $f(2k)=(k-1/2)^2-1/4$, we can write $$f(n)=\left\lfloor \frac{(n-1)^2}{4} \right\rfloor$$ Given $n\ge 1$, we're looking for $p\ge 0$ such that $$f(p)<n\le f(p+1)$$ $$\frac{(p-1)^2}{4}<n\le \frac{p^2}{4}$$ $$(p-1)^2<4n\le p^2$$ $$(p-1)^2\le 4n-1<p^2$$ $$p-1=\lfloor \sqrt{4n-1} \rfloor$$ giving us finally: $$f^*(n)=1+\lfloor \sqrt{4n-1} \rfloor$$ $$\boxed{G(n)=1+n+\left\lfloor \sqrt{4n-1} \right\rfloor}$$ so that $\{F(n):n\ge 1\}$ and $\{G(n):n\ge 1\}$ form a partition of $\mathbb N^*$.