Divisibility rule finder
2025/12/10
Enter any number, preferably an integer bigger than 0. This project can give you a simple rule for checking whether a number can be divided by it or not. I made the text small in case anyone wants to use really big numbers.
To avoid changing the result of a divisibility test, every number you add/subtract has to be a multiple of the divider. The rules used in this project alternate between getting rid of the units and dividing by 10.
Example: 2716 divisibility by 7. A simple way to get rid of the 6 units is by subtracting 21 * 6, because 21 is a multiple of 7 that ends in 1.
2716 - 21 * 6 = 2710 + 1 * 6 - 1 * 6 - 20 * 6. The 1 * 6 parts cancel out and you're left with 2710 - 20 * 6, which will have the same result as 271 - 2 * 6. Therefore, 7's divisibility rule involves adding -2 times the units digit to the rest of the number. You can simply repeat this until you get something you recognise is or isn't a multiple of 7.
If you wanted to, you could use an alternate method that involves adding 49 times the units digit, which is 50u - 1u, so you could have the units multiplied by 5 instead of -2 (Adding 9 decreases the units digit by 1 too).
In fact, you could use any multiplier two less than a multiple of 7 (positive or negative) because every 10th multiple of a number ends with the same digit, but smaller multipliers are easier for humans to work with.
Based on a YouTube video by Matt Parker. BTW He thought these kinds of rules only work for prime numbers, but it can actually be ANY number that doesn't share any factors with the base it's in!
Download
Install instructions
Requires Turbowarp (Not Scratch friendly)




Leave a comment
Log in with itch.io to leave a comment.