No.2609 Decreasing GCDs
Problem Statement
You are given an integer $N$. Output $1$ sequence $A = \left( A_1 , A_2 , \cdots A_N \right)$ consisting of $N$ integers greater than or equal to $1$ that satisfies all $3$ of the following conditions.
- For each integer $i$ satisfying $1 \leq i \leq N$, $A_i \leq 10^8$
- For each integer $i$ satisfying $1 \leq i \leq N-1$, $A_i < A_{i+1}$
- For each integer $i$ satisfying $1 \leq i \leq N-2$, $\mathrm{GCD} (A_i,A_{i+1}) > \mathrm{GCD} (A_{i+1},A_{i+2})$ (where $\mathrm{GCD} (x,y)$ denotes the greatest common divisor of $x$ and $y$)
It can be proved that a sequence satisfying the conditions exists under the constraints of this problem.
Input
$N$
- $3 \leq N \leq 25$
- All inputs are integers
Output
Output the elements of the sequence on one line, separated by spaces, in the following format, and end with a newline.
If there are multiple solutions satisfying the conditions, you may output any of them.
$A_1\ \ A_2\ \ \cdots A_N$
Sample
Sample 1
Input
3
Output
14 21 24
Condition number $1$ and condition number $2$ are clearly satisfied.
Since $\mathrm{GCD} (14,21) =7,\mathrm{GCD} (21,24) =3$, we can see that condition number $3$ is also satisfied.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
蜜蜂