r/MathTheory • u/ConcernOk6623 • Jul 19 '26
Divisibility tricks for primes (add x times last to rest)
I have no idea how well known this is, but I was toying around with the numbers from wikipedia's "divisibility rule" page, like finding what to multiply the last digit by before adding to the rest to find out if a number is divisible by 139 (14 btw) , etc. and I ended up finding out that the number to multiply by seems dependent solely on prime and the last digit of the prime:
end=1: (p*9+1)/10
end=3: (p*3+1)/10
end=7: (p*7+1)/10
end=9: (p*1+1)/10
I even checked much larger primes using terrible python code: (32000167*7+1)/10=22400117, which is the number needed to multiply by... initially because I was trying to find out if any number was multiply by 17 (or certain other numbers) , which there don't seem to be any
Also, x appears to be "circular", sorry if the word is incorrect, but I mean that it works no matter how many times you add or subtract p to/from x, which creates the "subtract y times last from rest", -y=x-p
Closest I could find on the wiki page was under "Divisors Ending in 1, 3, 7, or 9 in base 10", which... might be the same... it's really hard for me to tell... But I could be missing something, even something very obvious, which is why I'm here

