Consider the following step function: $f: \mathbb{N} \rightarrow \mathbb{N}, f(n) = \lfloor \frac{n^{2}}{2023} \rfloor$
Where $n \in [1, 2023]$. How many distinct values does the step function take?
Thanks!
Consider the following step function: $f: \mathbb{N} \rightarrow \mathbb{N}, f(n) = \lfloor \frac{n^{2}}{2023} \rfloor$
Where $n \in [1, 2023]$. How many distinct values does the step function take?
Thanks!
$45^2=2025$, so all values before $45$ return $0$.
$2023$ is the $1011$th odd number, so after $1011$ each interval between squares is equal to or greater than $2023$ and returns a new value.
Between $45$ and $1011$, you move from $45^2/2023=1.x$ to $1011^2/2023=505.x$ so you must have:
$0-44: 1$ value
$45-1011: 505$ values
$1012-2023: 1011$ values
For $1517$ values.
Edit: I can't do math: @Lozenges points out that $n=1012-2023$ yields $1012$ values for $1518$ total.