%% Euler's Theorem
% Euler's theorem states that a^{\phi(n)} \equiv 1 ({\rm mod}\; n) if and only if the two positive integers a and n are relatively prime. Show that the Euler phi function \phi(n) satisfies Euler's theorem for the integers a=15 and n = 4.

a = 15;
n = 4;
isCongruent = powermod(a,eulerPhi(n),n) == mod(1,n)

% Confirm that a and n are relatively prime.

g = gcd(a,n)

%
% Copyright 2019 The MathWorks, Inc.