# Check whether f : N→N given by f(x) x^2 +x +1is onto.

*print*Print*list*Cite

### 1 Answer

First, let's recall what it means for a function to be *onto *(also known as *surjective*). We say that a function `f: X \to Y` is *surjective* if for all *y* in *Y, *there exists an *x* in *X* such that *y = f(x)*.

Let's now apply this definition to our function `f(x) = x^2 + x + 1` keeping in mind that the function is only defined for natural numbers.

Any easy way to show a function is not onto is by showing a counter example.

Suppose, for contradiction, that *f* is onto. Let *y = 2*. Then there exists some natural number *x* such that `2 = x^2 + x + 1` Using the quadratic formula, we find that this has two solutions:

`x= 1/2 (-1 - \sqrt{5})` and `x = 1/2(\sqrt{5} - 1)`

But neither of these solutions are natural numbers. **Therefore f is not onto**.