1 条题解
-
0
自动搬运
来自洛谷,原作者为

ezoixx130
浴乎沂,风乎舞雩,咏而归搬运于
2025-08-24 22:07:16,当前版本为作者最后更新于2018-12-23 12:41:17,作者可能在搬运后再次修改,您可在原文处查看最新版自动搬运只会搬运当前题目点赞数最高的题解,您可前往洛谷题解查看更多
以下是正文
这里讲一种不用生成函数什么的东西求通项公式的方法:待定系数法
首先
设
则 满足 ,
即
解得$\Large q=\frac{233\pm\sqrt{56953}}{2},p=\frac{-233\pm\sqrt{56953}}{2}$
当$\Large q=\frac{233+\sqrt{56953}}{2},p=\frac{-233+\sqrt{56953}}{2}$ 时
$\Large a_{n+2}+\frac{-233+\sqrt{56953}}{2}a_{n+1}=\frac{233+\sqrt{56953}}{2}(a_{n+1}+\frac{-233+\sqrt{56953}}{2}a_n)$ (①式)
设
则$\Large b_{n+1}=a_{n+2}+\frac{-233+\sqrt{56953}}{2}a_{n+1}$
将上两式代入①式得
于是我们知道了 是等比数列。
又因为$\Large b_1=a_2+\frac{-233+\sqrt{56953}}{2}a_1=233+\frac{-233+\sqrt{56953}}{2}$
所以$\Large b_n=(\frac{233+\sqrt{56953}}{2})^{n-1}(233+\frac{-233+\sqrt{56953}}{2})=(\frac{233+\sqrt{56953}}{2})^n$
所以$\Large a_{n+1}+\frac{-233+\sqrt{56953}}{2}a_n=(\frac{233+\sqrt{56953}}{2})^n$
当$\Large q=\frac{233-\sqrt{56953}}{2},p=\frac{-233-\sqrt{56953}}{2}$ 时
同理得到$\Large a_{n+1}+\frac{-233-\sqrt{56953}}{2}a_n=(\frac{233-\sqrt{56953}}{2})^n$
上两式相减就可以得到$\Large \sqrt{56953}a_n=(\frac{233+\sqrt{56953}}{2})^n-(\frac{233-\sqrt{56953}}{2})^n$
$\Large a_n=\frac{(\frac{233+\sqrt{56953}}{2})^n-(\frac{233-\sqrt{56953}}{2})^n}{\sqrt{56953}}$
这就已经是这个数列的通项公式了。
但是我们只需要求这个数列在模意义下的值,因此还可以继续推。
我们要求 在模意义下的值,就是要找到满足的 。然后我们发现出题人选数选得刚刚好,我们找到了 。
然后就可以推出$\Large a_n \equiv \frac{(\frac{233+188305837}{2})^n-(\frac{233-188305837}{2})^n}{188305837} (\mod 10^9+7)$
最后得到$\Large a_n=233230706(94153035^n-905847205^n) (\mod 10^9+7)$
完美!
然后就可以用光速幂每次 求答案了。
- 1
信息
- ID
- 4064
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 6
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者