I'm studying the convergence of the sequence of functions $f_n:[0,1]\subset\mathbb{R}\to\mathbb{R}$ defined by $$f_n(x)=n^2x(1-x^2)^n$$ for $n\in\mathbb{N}$. These functions converge pointwise to the zero function $f(x)=0$.
Define the function $N(\epsilon,x):(0,\infty)\times[0,1]\to\mathbb{N}$ to be the smallest positive integer $N$ such that $$\forall m(m\in\mathbb{N}\land m\geq N\implies m^2x(1-x^2)^m<\epsilon)$$
Convergence and well-ordering guarantee this function is well-defined. Given $\epsilon$ and $x$, this function tells us how far out in the sequence $\left\{f_n(x)\right\}_1^\infty$ we must go in order to squeeze the remaining terms to within $\epsilon$ of $f(x)=0$. For fixed $\epsilon$, I know the dependence of $N$ on $x$ blows up as $x\to0^{+}$, but I thought it would be nice to see this explicitly.
Alas, while some values of this function are trivial to calculate, most aren't because of the mixture of polynomial and exponential dependence on $m$. Ideally I'd like to have Mathematica plot this function over $x\in[0,1]$ for fixed small $\epsilon$, say $\epsilon=1$ or $0.1$.
I can use Reduce to determine the set of all $n\in\mathbb{N}$ such that $n^2x(1-x^2)^n<\epsilon$ for fixed $x$ and $\epsilon$. For example, with $\epsilon=1$ and $x=0.2$, I use
Reduce[Element[n, Integers] && n^2 0.2 (1 - 0.2^2)^n < 1 && n > 0, {n}]
The output is
$n=1\lor n=2\lor(n\in\mathbb{Z}\land n\geq227)$
Using this, I deduce that $N(1,0.2)=227$, but I have two questions:
(1) I'm not sure how to code things to generate 227 directly (i.e. the value of my function $N(\epsilon,x)$ for fixed $\epsilon$ and $x$) without getting the entire solution set; all I want is the least integer that guarantees all larger integers are in the solution set, too.
(2) Nor do I know how to code things to handle variable (rather than fixed) $x$ and $\epsilon$. I'd be happy enough to fix $\epsilon$ and be able to plot $N(\epsilon,x)$ versus $x$.
ArgMin[{n, Reduce[ForAll[m, n < m && Element[n, Integers], m^2 0.2 (1 - 0.2^2)^m < 1 && m > 0], n]}, n]
(* 227 *)
. $\endgroup$