2020 Mock Combo AMC 10 II Problems/Problem 23
Problem
How many sequences satisfy that
for all
and that
is divisible by
if and only if
?
Solution 1
Call a sequence 5-free if
for all
and that
is never divisible by
. Let
be the number of
-free sequences
exist such that its sum has a remainder of
or
when divided by
(Note that it doesn't matter if it is divisible by 1 or 4 because if you switch every 2 with a 3 and vice versa, you form a bijection between them). Now we do case work on
to create a recurrence. Here I will assume that the sum of
has a remainder of
when divided by
.
If , the sequence
has a sum that has a remainder of
when divided by
, so we add
for this case.
If , the sequence
has a sum that has a remainder of
when divided by
, so
must equal
. Then
has a sum that has a remainder of
when divided by
. So we add
for this case.
These are all of the cases so and
and
by testing. Now let's return to the original problem. We will do casework on
.
If ,
as well and
has a sum that has a remainder of
when divided by
. We add
for this case.
If ,
similarly and
has a sum that has a remainder of
when divided by
. We also add
for this case.
So the answer is .
~sdfgfjh