math - (A^x) % Mod == (A^(x % (Mod - 1)) % Mod. if Mod is Prime. True when A is a matrix? -


(a^x) % mod == (a^(x % (mod - 1)) % mod. if mod prime.

is property true when 'a' matrix?

suppose a=
1 0 1
1 0 0
0 1 0

x=1000000007 , mod=1000000007

then ( a^x ) % mod is

097981108 432592815 646971665
646971665 451009450 432592815
432592815 214378850 451009450

but (a^1)%mod [ as, ( x % (mod-1) )=1 ] same matrix.

that property ( assuming understood correctly ) false.

just consider

a = 1 0 // 0 2 x = 3 mod = 2 

you

a^3 % 2  != a^0 % 2 

because

left : 1 0 // 0 0  right: 1 0 // 0 1 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -