# Pisano Period

## $\text{Definition}$

### $\text{Fibonacci}$数列

$\forall n\in\mathbb{N_+},F_{n+1}=F_n+F_{n-1}\quad(F_0=0,F_1=1)$

$\phi=\frac{1+\sqrt5}{2},\overline{\phi}=\frac{1-\sqrt5}{2}$，易知有$\phi^2=\phi+1$$\overline{\phi}^2=\overline{\phi}+1$

### $\text{Pisano Period}$

$F_n\bmod P$的循环节$m$是使得$F_m\equiv0\pmod P\wedge F_{m+1}\equiv1\pmod P$的最小正整数$m$

## $\text{Part.1}$

#### 引理$1$

$p\in\mathbb P,n\in\mathbb{N_+}$$a\equiv1\pmod p\Rightarrow a^{p^n}\equiv1\pmod{p^{n+1}}$

#### 推论$1$

$p\in\mathbb P,k\in\mathbb{N_+}$$m$$F_n\bmod p$的循环节，有$\phi^{mp^{k-1}}\equiv\overline{\phi}^{mp^{k-1}}\equiv1\pmod{p^k}$

$F_m\equiv\frac{\phi^m-\overline\phi^m}{\sqrt5}\equiv0\pmod p$可知$\phi^m\equiv\overline{\phi}^m\pmod p$

$\phi^m$替换$\overline{\phi}^m$得到$F_m\equiv\frac{(\phi^m-1)(\phi-\overline{\phi})}{\sqrt5}\equiv(\phi^m-1)F_1\equiv\phi^m-1\equiv0\pmod p$
$\therefore\phi^m\equiv\overline{\phi}^m\equiv1\pmod p$

### 引理$2$

$p\in\mathbb P\wedge p\ne5$$(\frac5p)=1\Leftrightarrow p\equiv\pm1\pmod5,(\frac5p)=-1\Leftrightarrow p\equiv\pm2\pmod5$

## $\text{Part.2}$

### 定理$1$

$P=\prod\limits_{i=1}^{s}p_i^{k_i}$$m_i$$F_n\bmod p_i^{k_i}$的循环节，$M$$F_n\bmod P$的循环节，则$M=\operatorname{lcm}(m_1,\cdots,m_s)$

$\because F_M\equiv0\pmod P\Leftrightarrow \forall i\in[1,s],F_M\equiv0\pmod{p_i^{k_i}}$
$\therefore\forall i\le s,m_i\mid M$
$\therefore M=\operatorname{lcm}(m_1,\cdots,m_s)$

### 定理$2$

$p\in\mathbb P$$m$$F_n\bmod p$的循环节，$M$$F_n\bmod p^k$的循环节，则$M\mid mp^{k-1}$

$\therefore F_{mp^{k-1}}\equiv\frac{\phi^{mp^{k-1}}-\overline\phi^{mp^{k-1}}}{\sqrt5}\equiv\pmod{p^k}$
$\therefore F_{mp^{k-1}+1}\equiv\frac{\phi^{mp^{k-1}+1}-\overline\phi^{mp^{k-1}+1}}{\sqrt5}\equiv\frac{\phi-\overline{\phi}}{\sqrt5}\equiv1\pmod{p^k}$
$\therefore M\mid mp^{k-1}$

### 定理$3$

$p\in\mathbb P$$m$$F_n\bmod p$的循环节，若$p\equiv\pm1\pmod5$，则$m\mid p-1$

$\therefore F_{p-1}\equiv\frac{\phi^{p-1}-\overline\phi^{p-1}}{\sqrt5}\equiv0\pmod p,F_p\equiv\frac{\phi^p-\overline\phi^p}{\sqrt5}\equiv\frac{\phi-\overline{\phi}}{\sqrt5}\equiv1\pmod p$
$\therefore m\mid p-1$

### 定理$4$

$p\in\mathbb P$$m$$F_n\bmod p$的循环节，若$p\equiv\pm2\pmod5$，则$m\mid 2p+2\wedge 2\nmid\frac{2p+2}m$

$\therefore\phi^p\equiv(\frac12+\frac{\sqrt5}{2})^p\equiv(\frac12)^p+(\frac{\sqrt5}2)^p\equiv(\frac12)^p(1+\sqrt5^p)\equiv\frac12(1+5^\frac{p-1}2\sqrt5)\equiv\frac12(1-\sqrt5)\equiv\overline{\phi}\pmod p$

$F_{p}\equiv\frac{\phi^p-\overline\phi^p}{\sqrt5}\equiv\frac{\overline\phi-\phi}{\sqrt5}\equiv p-1\pmod p$
$F_{p+1}\equiv\frac{\phi^{p+1}-\overline\phi^{p+1}}{\sqrt5}\equiv\frac{\overline\phi\phi-\phi\overline\phi}{\sqrt5}\equiv0\pmod p$
$F_{p+2}\equiv F_p+F_{p+1}\equiv p-1\pmod p$
$\therefore m\nmid p+1$

$F_{2p+1}\equiv\frac{\phi^{2p+1}-\overline\phi^{2p+1}}{\sqrt5}\equiv\frac{\overline\phi^2\phi-\phi^2\overline\phi}{\sqrt5}\equiv\frac{\phi\overline\phi(\overline\phi-\phi)}{\sqrt5}\equiv1\pmod p$
$F_{2p+2}\equiv\frac{\phi^{2p+2}-\overline\phi^{2p+2}}{\sqrt5}\equiv\frac{\overline\phi^2\phi^2-\phi^2\overline\phi^2}{\sqrt5}\equiv0\pmod p$
$F_{2p+3}\equiv F_{2p+1}+F_{2p+2}\equiv1\pmod p$
$\therefore m\mid 2p+2$

### 定理5

$P=2\times5^k(k\in\mathbb{N_+})$，则$F_n\bmod P$的循环节为$6P$，否则$F_n\bmod P$的循环节$\le4P$

## $\text{Extra}$

$m_i=\begin{cases}3&p_i=2\\20&p_i=5\end{cases}$

posted @ 2019-08-20 20:10  Shiina_Mashiro  阅读(2698)  评论(3编辑  收藏