a_n=begin{cases}0 & n = 1 \ a_{lfloor frac{n}{2} rfloor} + (-1)^{frac{n(n+1)}{2}} & n ge 2end{cases}. Chiaki would like to know the sum of the first n terms of the sequence, i.e.∣. As this number may be very large, Chiaki is only interested in its remainder modulo .
Chiaki is interested in an infinite sequence a1, a2, a3, ..., which defined as follows: a_n=begin{cases}0 & n = 1 \ a_{lfloor frac{n}{2} rfloor} + (-1)^{frac{n(n+1)}{2}} & n ge 2end{cases} a n ={ a ⌊ 2 n ⌋ +(−1) 2 n(n+1) n=1 n≥2 Chiaki would like to know the sum of the first n terms of the sequence, i.e. sumlimits_{i=1}^{n}|a_i| i=1 ∑ n ∣a i ∣. As this number may be very large, Chiaki is only interested in its remainder modulo (109 + 7).
(图片来源网络,侵删)