First note that it's impossible for , since if it were true we would know that: but we require this sum to be equal to , therefore we know that . So we have an upper bound on the value of
Suppose that , therefore , and thus by taking then clearly is at a maximum as needed, and by taking we have Also note that in this case.
Otherwise , therefore , therefore we can certainly not pick , and as stated earlier we cannot have exceed this value, so the next largest value would the largest integer less than or equal to which is defined as
Recall that by the quotient remainder theorem there exists some such that , and that specifically we have that and which yields the equation
And note that since
, well that is
, we know that
and thus the sequence given by
for
and
is clearly bounded below by
, and has sum equal to
, and has
terms, so the largest value of
is preciely that.