Prime Factors of Large Numbers I am taking a math competition tomorrow, and I was confused on a practice problem. 
Problem 10
A majority of the 30 students in Ms. Demeanor's class bought pencils at the school bookstore. Each of these students bought the same number of pencils, and this number was greater than 1. The cost of a pencil in cents was greater than the number of pencils each student bought, and the total cost of all the pencils was $17.71. What was the cost of a pencil in cents?
http://wiki.artofproblemsolving.com/index.php/2011_AMC_10A_Problems/Problem_10 
On the solution link (above), I didn't understand how 1771 was immediately factored out. How can this be done?
 A: If you are familiar with divisibility by $11$, it is obvious that $1771$ is a multiple of $11$. If not, you just need to "see" that
$$1771=1111+660$$
and both $1111$ and $660$ are clearly multiples of $11$.
A: Hint $\,\ 11\mid 1771\ $ by $\rm\ {\rm mod}\ 11\!:\ abba\, =\, \overbrace{a\,10^3\!+\!b\,10^2\!+\!b\, 10\!+\!a}^{reduce\,\ \color{#c00}{10\,\equiv\, -1}\ \ }\, \equiv\, -a+b-b+a \equiv 0\,$
Note $\ \color{#c00}{x = -1}\,$ is a root of  $\,c_0 + c_1 x + c_2 x^2 + \cdots + c_n x^n\,$ if $\,c_0\!-\!c_1\!+\!c_2\!-\!c_3\!+\cdots + (-1)^n c_n = 0.\,$ In particular this is true if the coefficient sequence has even length and is a palindrome. Thus evaluating such a palindromic polynomial at $\,x = b\,$ shows that an even length palindrome number in radix $\,b\,$ is divisible by $\,b+1,\,$ since $\,\color{#c00}{b\equiv -1}\pmod{b+1}.\,$ Above is the special case $\,b=10.$
A: The interesting thing about divisibilty by 11 is that you can do it by adding up alternate digits (modulo 11) and subtract this from the sum of the other alternative digits (modulo 11).  If you get zero, then the number is divisible by 11.
So for 1771 you can add 1 to 7 (and get 8) ad subtract this from (7 + 1) (which is 8) and get zero.  Therefore 1771 is divisible by 11.
This works because 11 is 10+1, where 10 is the number base we work in.  Had it been hexadecimal, then you'd be able to add up each alternate hex digit and subtract from the sum of the remaining alternate digits, and if you get zero then your number would be divisible by 17 (which is 16(our number base) plus 1).
The thing about divisibility rules is that they work out the remainder you'd get if you did the division, but without doing the division itself.
A: Besides the comment of @Not Me, note that any number of the form $1nn1$ is divisible by $11$:
$1nn1 = 11\times 1(n-1)1$
where you view $n$ and $n-1$ as digits. This is simple to verify, and would seem to be very relevant to the problem.
A: For a number of this size it's feasible to do modular arithmetic calculations in one's head. 
Since $100 \pmod{7} \equiv 2$, $1000 \pmod{7} \equiv (10 \pmod{7})(100 \pmod{7}) \equiv 6 \pmod{7}$, so $1771 \pmod{7} \equiv (6 \pmod{7}) + (771 \pmod{7}) \equiv 0$.
A: Here is a completely different simple method of factoring this out, it is just coincidence [i.e. practice] that we can recognize these patterns:
$$1771=2500-729\,.$$
is a difference of two squares. This is a natural observation if you are familiar with the powers of $3$.
