Range of $\lfloor9^x - 3^x + 1\rfloor\ \forall \ x \in (-\infty, 1)$ I have been asked:

Let $f(x) = \lfloor9^x - 3^x + 1\rfloor \ \forall \ x \in (-\infty, 1)$, then what is the range of $f(x)$?

Upon encountering this question, I started putting in values for different $x$ and figured that $f(0) = 1$ and $f(-1)=0$ and then I realized that for all values of $x$ less than zero, $f(x)$ is always zero. Therefore, I thought the range of the given function must be $\{0, 1\}$.
But the answer states that the range should be $\{1, 2, 3, 4, 5, 6\}$. Why is zero not on the list? How are all these other values coming about? I understand that these values must come upon inputting values from $(0,1)$ but I cannot think of any method/approach to get there.
How should I proceed with this problem? And why?

Write $y=3^x$, which has range $(0,3)$ when $x\in(-\infty,1)$. The expression becomes $\lfloor y^2-y+1\rfloor$, of which the subexpression inside the floor has a minimum at $\frac12$ of $\frac34$. When $y=0$ we get $1$ and at $y=3$ we get $7$ – but since the interval is open, $7$ is never attained. Hence the range of $f$ is $\{0,1,2,3,4,5,6\}$.
