A notation question on how to properly denote a function that takes inputs only of a certain form.

35 Views Asked by At

Suppose I have a set $B = \{n^2 + n + 1 : n \in \mathbf{N}\}$ and I want to define a function $g: B \rightarrow \mathbf{N}$ that only accepts as it's arguments numbers of the form $n^2 + n + 1$ for $n \in \mathbf{N}$ and returns $n$. How would I say that in function notation when writing a proof? Would this be correct:

"Let $g: B \rightarrow \mathbf{N}$ be the function defined by $g(n^2 + n + 1) = n$."

That doesn't look right.

1

There are 1 best solutions below

1
On

You can use $g(m)= \frac{\sqrt{4m-3}-1}{2}$, if $m$ is always of the form $n^2+n+1$. This gives $g(m)=n$.