Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2017/imperative-programming-resit/2/a/solution

For , , and integer , all terms are nonnegative, so squaring preserves the inequalities:
This gives integer-square membership in a square-root Beatty sequence without evaluating a floating-point square root. Since , any witnessing satisfies .

New to topics? Read the docs here!