450. Signal Lights. Two spies on opposite banks of a river came up with a way to signal at night using a frame (similar to the one shown in the picture) and three lamps. Each lamp could emit white, red, or green light. The spies developed a code in which each signal meant something.

![](https://cdn.mathpix.com/cropped/2024_05_21_56f37ca27ac3d928838dg-157.jpg?height=334&width=594&top_left_y=1392&top_left_x=731)

Of course, you understand that one lamp, no matter which hook it is hung on, will have only one value. Two lamps hung on the upper hooks 1 and 2 are indistinguishable from two lamps hung on hooks 4 and 5. Two red lamps on hooks 1 and 5 can be distinguished from lamps on hooks 1 and 6, and two lamps on hooks 1 and 2 are different from two lamps on hooks 1 and 3.

Considering all this variety of lamp positions on the hooks and the color of the signals, answer how many different signals can be sent.
450. With three red, white, or green lamps, we can obtain 15 different combinations (45). With one red and two white lamps, we can also obtain 15 combinations, and for each of them, there are 3 more combinations of the order of colors; in total, 45 combinations. The same result will be obtained with one red and two green lamps, one white and two red lamps, one white and two green lamps, one green and two white lamps, and one green and two red lamps (270). With one red, one white, and one green lamp, we can obtain 6 times 15 combinations (90). With two red, two white, or two green lamps, we can obtain 7 combinations each (21). With one red and one white, or one red and one green, or one white and one green lamp, we can obtain 14 combinations each (42). Using only one lamp, we can send only 1 signal each (3). Now add the numbers in parentheses, and you will get the answer - 471 signals.