No.2995 The Ruler Sequence Concatenation
問題文最終更新日: 2024-12-19 11:30:22
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Advent Calendar Contest 2024
(順位表)
の他の問題:
Background
This problem was originally proposed by kroton and solved by noshi91.
Problem Statement
Define the sequence of positive integers $R _ n$ as follows.
- $R _ 1 = 1$
- $R _ n = \operatorname{cat}(R _ {n - 1}, n, R _ {n - 1}) \quad (n \geq 2)$
Given $n$, output $R _ n \bmod 998244353$.
Input
$n$
- $1 \leq n \lt 10^{18}$
- $n$ is an integer
Output
$R _ n$
Output the remainder when divided by $998244353$.
Sample
Sample 1
Input
3
Output
1213121
Sample 2
Input
10
Output
269257815
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
noshi91
Nachia