Take the last digit (n mod 10) and double it.

Take the rest of the digits (n div 10) and subtract the doubled last digit from it.

The resulting number is divisible by 7 iff the original number is divisible by 7.

Example:

Take 53445

Subtract (53445 mod 10) * 2 from (53445 div 10)

= -5 * 2 + 5344 = 5334

533 - 2 * 4 = 525

52 - 5 * 2 = 42 which is divisible by 7

so 53445 is divisible by 7.