Problem E. Necklace of Beads
时间限制 1000 ms
内存限制 32 MB
Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 40 ). If the repetitions that are produced by rotation around the center of the circular necklace or reflection to the axis of symmetry are all neglected, how many different forms of the necklace are there?
输入数据
输出数据
The output should contain the output data: Number of different forms, in each line correspondent to the input data.
样例输入
样例输出
$ Mathjax font initiator $