Integer-square membership in a square-root Beatty sequence
ID: integer-square-membership-in-a-square-root-beatty-sequence
For positive integers , the floor function condition is equivalent to the displayed integer inequalities. Since , a witness satisfies . Finding the least with and checking the strict upper bound therefore decides membership by binary search. Scanning successive values with a persistent increasing witness index instead enumerates all values below a bound in linear time arithmetic-operation count. Exact integer comparison avoids floating-point errors near an integer boundary.
New to topics? Read the docs here!