Given a number $n$ and a prime number $p$, we aim to divide $n$ into $r$ digit numbers and sum them to check $n$'s divisibility by $p$.
I'm asked to prove that $r$ is a divisor of $p-1$. I think that we need to use fermat's little theorem for this purpose, but I can't get anywhere from there.
Your help is appreciated.
EDIT:
Given $n = 562437487$ and $p=3$, one way to check for divisibility of $n$ by $p$ is to sum all numbers in $n (5 + 6 + 2 + 4 + 3 + 7 + 4 + 8 + 7 = 46)$ and check for the result's divisibility by $p$. Hence, $r$ here is equal to $1$ since we are adding all the digits in n together. For other prime numbers such as $13$, $r$ is $6$ not $1$ and so on.