Consider the following two sequences and . We denote as the -th element in sequence , and as the -th element in sequence :
- Sequence is a sequence where for all , appears in sequence for times ( is the set of all positive integers). That is to say,
- Sequence can be derived from the following equations:
That is to say,

Given a positive integer , please calculate the value of .