prime divisibility:v what is the formula? I know how to divide certain numbers, like $$\frac{x}{2}$$ whereas $x$ ends in 2, 4, 6, 8, or 0. and my idea to represent $x$ is $$a+10b+100c+1000d...$$ and it is divisible by 3 if $$\frac{a+b+c+d...}{3}$$ is a whole number.
$\frac{x}{5}$ is possible if the number ends in 0 or 5. 
$\frac{x}{6}$ is possible if $\frac {x}{3}$ and $\frac{x}{2}$ are both possible. this is the same for all composite numbers. 
my big question is: what about larger $$\frac{x}{p}$$ where p is any prime number and x is any number you are trying to test? is there any formula that can be directly applied to any prime-regular number combination to find the divisibility? 
 A: You have asked about two different kinds of divisibility tests.
The tests for divisibility by $2$ and $5$ work so nicely because we write our numbers in base $10$ and those are the prime factors of $10$. If we wrote using a different base $b$ we could test for divisibility by a prime factor of $b$ by checking just the last (units) digit.
In base $10$ there are digit tests for other numbers too. You show that you know that to test for divisibility by $3$ or $9$ you use the sum of the digits. For $11$ you look at the alternating sum and difference of the digits. For $4$ you look at the last two digits. There's a test for $7$ too, but it's really ugly.
The second kind of test you're thinking about is the one you quote for $6$. If a number is divisible by each of two primes $p$ and $q$ then it will be divisible by their product $pq$. That's a fact about numbers and doesn't depend on the base you use to write them. (It can also be generalized a bit.)
See https://en.wikipedia.org/wiki/Divisibility_rule (and other web links for "divisibility test").
A: I know the following about the general case for base $b$;
If $p|b$, then you can check divisibility by $p^k$ by checking the last $k$ digits of the number in question.
If $b \equiv 1 \pmod{p}$, then the sum of digits test applies.
If $p-1=b$, then the alternating sum of digits test works.
I am under the impression (possibly mistaken) that is is always possible to construct a digit test, however in the majority of cases it is rather absurd and not worth doing. 
