# Difference between revisions of "2013 AIME I Problems/Problem 2"

## Problem 2

Find the number of five-digit positive integers, $n$, that satisfy the following conditions:

(a) the number $n$ is divisible by $5,$
(b) the first and last digits of $n$ are equal, and
(c) the sum of the digits of $n$ is divisible by $5.$

## Solution

The number takes a form of $5\text{x,y,z}5$, in which $5|x+y+z$. Let $x$ and $y$ be arbitrary digits. For each pair of $x,y$, there are exactly two values of $z$ that satisfy the condition of $5|x+y+z$. Therefore, the answer is $10\times10\times2=\boxed{200}$

This 9-line code in Python also gives the answer too. import math counter=0 for integer in range(10000,99999):

 if str(integer) != '5' or str(integer) != '5':
counter=counter
else:
if math.remainder(int(str(integer)+str(integer)+str(integer)),5)==0:
counter+=1


print(counter)

## Video Solution

The problems on this page are copyrighted by the Mathematical Association of America's American Mathematics Competitions. 