2019 cattle off more school fifth generator 1-- generalized Fibonacci cycle power section && matrix fast

Theoretical part

Quadratic residue

In number theory, integer $ X $ of $ p $ integer quadratic remaining $ X 2 $ refers to the remainder of dividing $ p $ ^.

When there is a $ X $, so that the equation $ X ^ 2 \ equiv d (mod \ p) $ holds, called "$ d $ modulo $ p $ of quadratic residue"

If for $ X $, $ X ^ 2 \ when equiv d (mod \ p) $ is not set up, called "$ d $ $ p $ is a secondary mode of non-surplus"

The similarity matrix diagonalization

Similarity matrix: Matrix for $ A $ B $ and $, $ P $ invertible if present, such that $ P ^ {- 1} AP = B $, called $ A $ B $ similar to $, denoted by $ A \ sim B $.

Matrix diagonalization refers similar diagonal matrix, i.e., $ P ^ {- 1} AP = diag (\ lambda _1, \ lambda _2, ..., \ lambda _n) $

Theorem: $ n $ $ A $ order matrix and a diagonal matrix and Sufficient Conditions are similar n-$ A $ $ $ has linearly independent eigenvectors. Simple judgment is $ | A | \ neq 0 $.

analysis

From generalized Fibonacci acdreamers column to find the loop section , where just comb.

The recursive representation as a transition matrix, the transition matrix is ​​equivalent to simply locate period.

I.e. seeking minimum $ n $, such that

$${\begin{bmatrix} a & b\\ 1 & 0 \end{bmatrix}}^n(mod \ p) = \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix}$$

We can find a satisfying the condition $ n $, and then enumerate its factors.

Provided similar to $ A $ $ D $, $ A $ characteristic roots were $ \ lambda _1, \ lambda _2 $.

D is the

$D = \begin{bmatrix} \lambda _1 & 0\\  0 & \lambda _2 \end{bmatrix}$

Because $ A ^ n = T ^ {- 1} D ^ nT $, so $ D ^ n \ when equiv I (mod \ p) $, $ D ^ n \ equiv I (mod \ p) $

由于$$D^n = {\begin{bmatrix} \lambda _1 & 0\\  0 & \lambda _2 \end{bmatrix}}^n = D = \begin{bmatrix} \lambda _1^n & 0\\  0 & \lambda _2^n \end{bmatrix}(mod \ p) = I$$

Thus $ \ lambda _1 ^ n \ equiv 1 (mod \ p), \ \ lambda _2 ^ n \ equiv 1 (mod \ p) $.

How to find $ n $ it?

Conclusion directly on it! (Read 555)

6,187,655 $ \ Delta = a ^ 2 + 4b $

  • If $ \ $ of Delta is the quadratic residue $ p $, $ n = p-1 $
  • If $ \ $ of Delta quadratic non-residue of $ p $, $ n = (p + 1) (p-1) $
  • If $ \ Delta = p $, can not be of similar. Fortunately, the topic will not happen

Conclusion or for $ p $ is a prime number, $ p $ is a composite number it?

First, the prime factorization of $ p = p_1 ^ {a_1} p_2 ^ {a_2} ... p_k ^ {a_k} $,

Provided $ g (x) $ length of circular section mold $ x $, conclusions $ g (p_i ^ {a_i}) ​​= p_i ^ {a_1-1} g (p_i) $

and so

$$
\begin{aligned}
g(x) & =g(p_1^{a_1}p_2^{a_2}...p_k^{a_k})\\
&= p_1^{a_1-1} g(p_1) \cdot  p_2^{a_2-1} g(p_2) ...  p_k^{a_k-1} g(p_k)\\
&= (p / p_1p_2... p_k) g(p_1)g(p_2) ...   g(p_k)
\end{aligned}$$

achieve

I will not judge quadratic residue, used directly as $ (p + 1) (p-1) $, big deal more multipliers.

Logically the smallest section is not circular n-$ $, but $ $ n-factor, and then determining an exploded feeling very troublesome, whether big deal more multipliers.

 

Guess you like

Origin www.cnblogs.com/lfri/p/11291757.html