Is it possible to know if $X$ is divisible by $Y$ without dividing $X$ by $Y$.

112 Views Asked by At

Background

I am working on a project involving FPGA's (a configurable logic circuit) and modulus of numbers to determine if $X$ is divisible by $Y$. When I take the modulus of a number a full division circuit is used which uses to many of the FPGA's resources.

The Question

Is it possible to know if $X$ is divisible by $Y$ without completing the full division process? I know that there are specific rules for numbers like $2$ and $3$, but is there a general one?

Is it possible to know if it is divisible part way through the division process without completing it?

Update

$Y$'s range is from $2$ to sqrt($X$).

I can make $Y$ be the set of numbers $A$ * $K$ + $C$ where $K$ and $C$ are constant.

This is my first post on this page so let me know if I made a mistake or if it should be in a Computer Science or Electrical Engineering page instead because of the content of the actual math and not the implementation

Also please edit tags as I am not sure how to tag questions here

1

There are 1 best solutions below

7
On BEST ANSWER

There are ad hoc solutions for most values of $Y$, but no general answers. If you have particular numbers or forms of numbers in mind we can be more detailed.