Description
Link.
求 (sum_{i=1}^{n} ext{fibonacci}_{i} imes i^{k}=sum_{i=1}^{n}(F_{i-1}+ ext{fibonacci}_{i-2}) imes i^{k}),(1le nle10^{17},1le kle40)。
Solution
简记 (F_{i}= ext{fibonacci}_{i})。首先我们作个差:
[ans_{n}=sum_{i=1}^{n}F_{i} imes i^{k}=sum_{i=1}^{n}(F_{i-1}+F_{i-2}) imes i^{k} \
ans_{n}-ans_{n-1}=F_{n} imes n^{k} \
]
然后:
[egin{aligned}
ans_{n}&=ans_{n-1}+F_{n} imes n^{k} \
&=ans_{n-1}+F_{n-1} imes(n-1+1)^{k}+F_{n-2} imes(n-2+2)^{k} \
&=ans_{n-1}+left(sum_{i=0}^{k}A_{i-1}(i) imesinom{k}{i}
ight)+left(sum_{i=0}^{k}A_{i-2}(i) imesinom{k}{i} imes2^{k-i}
ight)
end{aligned}
]
后面的 dirty work 实在不想做,口胡选手选择放弃。
Oops, something went wrong.