310305: CF1812D. Trivial Conjecture
Description
$$f(n) = \left\{ \begin{array}{ll} \frac{n}{2} & n \equiv 0 \pmod{2}\\ 3n+1 & n \equiv 1 \pmod{2}\\ \end{array} \right.$$
Find an integer $n$ so that none of the first $k$ terms of the sequence $n, f(n), f(f(n)), f(f(f(n))), \dots$ are equal to $1$.
InputThe only line contains an integer $k$ ($1 \leq k \leq \min(\textbf{[REDACTED]}, 10^{18})$).
OutputOutput a single integer $n$ such that none of the first $k$ terms of the sequence $n, f(n), f(f(n)), f(f(f(n))), \dots$ are equal to $1$.
Integer $n$ should have at most $10^3$ digits.
ExamplesInput1Output
5Input
5Output
6Note
In the first test, the sequence created with $n = 5$ looks like $5, 16, 8, 4, 2, 1, 4, \dots$, and none of the first $k=1$ terms are equal to $1$.
In the second test, the sequence created with $n = 6$ looks like $6, 3, 10, 5, 16, 8, 4, \dots$, and none of the first $k=5$ terms are equal to $1$.
Input
题意翻译
定义 $f(n)=\begin{cases}\frac n2&n\equiv0\pmod2\\3n+1&n\equiv1\pmod2\end{cases}$,请输出一个整数 $n$ 使得含有 $k$ 项的序列 $n,f(n),f(f(n)),\dots$ 所有项均不为 $1$。Output
\[ f(n) = \left\{ \begin{array}{ll} \frac{n}{2} & \text{if } n \equiv 0 \pmod{2}\\ 3n+1 & \text{if } n \equiv 1 \pmod{2} \end{array} \right. \]
需要找到一个整数 \( n \),使得序列 \( n, f(n), f(f(n)), f(f(f(n))), \dots \) 的前 \( k \) 项都不等于 1。
输入数据格式:输入一个整数 \( k \)(\( 1 \leq k \leq \min(\textbf{[REDACTED]}, 10^{18}) \))。
输出数据格式:输出一个整数 \( n \),使得序列的前 \( k \) 项都不等于 1。整数 \( n \) 最多有 \( 10^3 \) 位数字。题目大意:给定一个函数 \( f(n) \) 定义如下: \[ f(n) = \left\{ \begin{array}{ll} \frac{n}{2} & \text{if } n \equiv 0 \pmod{2}\\ 3n+1 & \text{if } n \equiv 1 \pmod{2} \end{array} \right. \] 需要找到一个整数 \( n \),使得序列 \( n, f(n), f(f(n)), f(f(f(n))), \dots \) 的前 \( k \) 项都不等于 1。 输入数据格式:输入一个整数 \( k \)(\( 1 \leq k \leq \min(\textbf{[REDACTED]}, 10^{18}) \))。 输出数据格式:输出一个整数 \( n \),使得序列的前 \( k \) 项都不等于 1。整数 \( n \) 最多有 \( 10^3 \) 位数字。