Throughout the solution, we will use diagrams like
the one below to represent a way to colour the flower. Each circle
corresponds to a petal, and the capital letters R, O, Y, and B represent the colours red, orange,
yellow, and blue, respectively. For example, the diagram representing
the petals coloured red, blue, yellow, blue, red, orange starting at the
top petal in clockwise order is
[[IMAGE0]]
For now, we will count the number of ways to colour the petals
according to the rules with the additional assumption that the top petal
is red. Using this assumption, we will consider cases based on how many
times the colour red is used.
Before reading on, you should convince yourself that it is not possible
to colour four or more petals red without causing two neighbouring
petals to be coloured red.
Case 1: Red is used three times.
Because two neighbouring petals must have different colours, there is
only one choice of which three petals are coloured red
[[IMAGE1]]
The rest of the petals can be coloured in any way using the other
three colours, so there are 3×3×3=27 ways to colour the
petals in this case.
Case 2: Red is used two times.
There are three possibilities of which two petals are coloured
red.
[[IMAGE2]] [[IMAGE3]]
[[IMAGE4]]
Consider the second of these configurations.
The two petals that neighbour the top red petal can each be coloured any
of the three remaining colours.
Once these two (independent) choices are made, the remaining two petals
can be independently coloured using one of exactly two possible
colours.
Therefore, the colouring of the middle configuration can be completed in
3×3×2×2=36 different
ways.
In the first configuration, the petal between the two red petals can be
coloured in any of 3 ways, and this
choice is independent of the way the other three petals are
coloured.
The other three petals can either be coloured three different colours
(x, y, and z), or they can be coloured using two
different colours (u and v), as shown below:
[[IMAGE5]] [[IMAGE6]]
If three colours are used, then there are 6 ways to choose them since we can choose
x in any of 3 ways, then choose y in any of two ways, and then z is forced.
If two colours are used, then there are 3 ways to choose u and then 2 ways to choose v, for a total of 6 ways.
Thus, there are 6+6=12 ways to
colour the three petals (other than the one between the two red
petals).
Since there are 3 ways to colour
the petal between the red petals, there are 3×12=36 ways to complete the
colouring for this configuration.
The third configuration can be coloured in 36 ways as well, so there are 36+36+36=108 ways to colour the petals in
this case.
Case 3: Red is used one time.
We can imagine colouring the petals one at a time in the clockwise
direction starting from the red petal.
There will be 3 choices for the
first petal since the only restriction is that we cannot use red.
The next petal has 2 options since
it cannot be the same colour as the previous petal, but it also cannot
be red.
Continuing in this way, there are 2
options for the 4th
petal, and 2 options for the 5th petal.
The final petal also has two options since its two neighbours have two
different colours. This is because we have not used red other than to
colour the top petal.
Therefore, there are 3×2×2×2×2=48 ways to
colour the petals in this case.
From the three cases, we get a total of 27+108+48=183 ways to colour the petals
so that the top petal is red.
There are 4 choices for the colour
of the top petal and each will lead to a count of 183.
Therefore, the number of ways to colour the petals according the the
given rules is 4×183=732.
The last two digits of 732 make the
integer 32, which is the answer to
the question.