Generate the snowflake pattern sequence
I define a snowflake pattern as a series of rings. Each ring has a certain number of points, with the following restrictions:
- The innermost ring must have between 1 and 8 inclusive points
- Every other ring must have between 2 and 8 inclusive points
- Every ring must have a integer multiple times as many points as the next smallest ring.
Valid snowflake sequences, from the smallest to the largest ring, include: 1,2,2,6
, 2,4,8
, 3,6
, 8,8,8,8,8
, etc.
Your task is, given a number, output a snowflake sequence with that total number of points.
If there are multiple solutions, find the most aesthetically pleasing one as follows:
- The one with the most unique ring sizes
- Unique ring sizes being equal, the one with the biggest smallest ring. Eg.
2,6
is better than1,7
. - If the unique ring sizes and smallest ring are both equal, output the one with the smallest total number of rings.
If there are still multiple options, you may choose one arbitrarily.