In this challenge you will be tasked with implementing a sequence of natural numbers such that:
- Each number appears a natural number of times
- No two numbers appear the same number of times
- No two numbers appear in the sequence next to each other more than once.
For some examples, the sequence
Is not valid because
1 appears an infinite number of times.
Is also not valid because every number appears exactly once, but different numbers must appear a distinct number of times.
meets the first two criteria but
2 occurs next to
3 two different times (
One sequence that meets all the criteria is:
You may use any option available in the default sequence rules. You should assume natural numbers include 0. You may assume they don't, but it won't do you any help.
This is code-golf so the goal is to minimize the size of your source code as measured in bytes.