------
## 最终结论
```python
def sequence(n):
    if n < 1:
        return 0
    elif n == 1 or n == 2:
        return 1
    else:
        p = [0] * (n + 1)
        p[1], p[2] = 1, 1
        for i in range(3, n + 1):
            p[i] = p[p[i - 1]] + p[i - p[i - 1]]
        return p[n]

assert sequence(10) == 6
assert sequence(2) == 1
assert sequence(3) == 2
```