#P8749. [蓝桥杯 2021 省 B] 杨辉三角形
[蓝桥杯 2021 省 B] 杨辉三角形
Problem Description
The figure below is the well-known Pascal's Triangle:

If we list all numbers in order from top to bottom and from left to right, we get the following sequence:
$1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, \ldots$
Given a positive integer , output the position (which term) where first appears in the sequence.
Input Format
Input one integer .
Output Format
Output one integer representing the answer.
6
13
Hint
For of the test cases, .
For all test cases, .
Lanqiao Cup 2021, Round 1, Provincial Contest, Group B, Problem H.
Translated by ChatGPT 5