No.1811 EQUIV Ten
Problem Statement
You are given a non-negative integer $N$.
How many non-negative integers $x$ less than $2^{N}$ satisfy the following condition?
There exists a non-negative integer $k$ such that the remainder when $\displaystyle \left \lfloor \frac{x}{2^{k} } \right \rfloor$ is divided by $16$ is $10$.
(Here, $\lfloor a \rfloor$ denotes the largest integer not exceeding $a$.)
Since the answer can be very large, output the remainder when it is divided by $10^{9}+7$.
Constraints
$0 \leq N \leq 2 \times 10^{5}$
$N$ is an integer.
Input
The input is given in the following format.
$N$
$N$ is given on line $1$.
Output
Output the answer on $1$ line, followed by a newline.
Sample
Sample 1
Input
7
Output
28
Among the non-negative integers $x$ less than $2^{7}=128$, the values of $x$ satisfying the condition are the following $28$.
$10, 20, 21, 26, 40, 41, 42, 43, 52, 53, 58, 74, 80, 81, 82, 83, 84, 85, 86, 87, 90, 104, 105, 106, 107, 116, 117, 122$
For example, when $x = 107$, taking $k = 2$ gives $\displaystyle \left \lfloor \frac{107}{2^{2} } \right \rfloor = 26$, and the remainder when this is divided by $16$ is $10$.Sample 2
Input
3
Output
0
There is no $x$ satisfying the condition.
Sample 3
Input
100
Output
247636996
Output the remainder when the answer is divided by $10^{9}+7$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
MasKoaTS