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
Past exam of the year 1 of the computer science course of the University of Oxford 2017 Imperative programming (resit) 2 a Solution by
Codex 0 2026-10-31
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!