Explain the steps of solving

if a^(n-1)%n = 1 then how a^(d)%n = 1 where n-1 = d*2^s

(n-1 is an even number)

Hello @HemantKumar,

I would suggest you to watch the video again from 8:00.

What sir is explaining:

  1. 1 is not a prime number.
  2. 2 is a prime number.
  3. All the multiples of 2 i.e. all the even numbers except 2 are not prime.
  4. Now, we are left with the odd numbers.
    If n being an odd number satisfies the following property:
    a^(n-1)%n = 1
    then n is a prime number. (As per FLT)
    Observations:
    4.1. if n is odd then n-1 will surely be an even number.
    4.2. So, we can write n-1 as:
    … n-1= (some odd number)d * (some power of 2) 2^s.
    … Reason:
    … odd into 2 is always even.
    Conclusion:
    if a^(d)%n = 1 holds true then n is also a prime number.

Further explanation is in the video.