#P8676. [蓝桥杯 2018 国 A] 自描述序列
[蓝桥杯 2018 国 A] 自描述序列
Description
Xiaoming is studying a sequence called the Golomb self-describing sequence, denoted as . This sequence has two interesting properties:
-
For any positive integer , appears in the whole sequence exactly times.
-
This sequence is non-decreasing.
The following are the first few terms of :
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | ||||||||
Given an integer , can you help Xiaoming compute the value of ?
Input Format
An integer .
Output Format
Output one integer, which is the answer.
13
6
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, .
Time limit: 1 second, 256 MB. Lanqiao Cup 2018, the 9th National Finals.
Translated by ChatGPT 5
京公网安备 11011102002149号