Maria was a brilliant mathematician who found the following property about her year of birth: if $f$ is a function defined in the set of natural numbers $N = \{0, 1, 2, 3, 4, 5,...\}$ such that $f(1) = 1335$ and $f(n+1) = f(n)-2n+43$ for all $n \in N$, then his year of birth is the maximum value that $f(n)$ can reach when $n$ takes values in $N$. Determine the year of birth of Mary.
Problem
Source: OLCOMA Costa Rica National Olympiad, Final Round, 2022 p4
Tags: algebra, function, functional equation