%% Euler's Product Formula
% If a positive integer n has prime factorization n = p_1^{k_1}\;p_2^{k_2}\;\ldots\;p_r^{k_r} with distinct prime factors p_1, p_2, \ldots, p_r, then the Euler phi function satisfies the product formula
% \phi(n) = n\left(1-\frac{1}{p_1}\right)\left(1-\frac{1}{p_2}\right)\ldots\left(1-\frac{1}{p_r}\right).
% The integer n = 36 has distinct prime factors 2 and 3. Show that \phi(36) satisfies the Euler's product formula.
% Declare 36 as a symbolic number and evaluate \phi(36).

n = sym(36)

% List the prime factors of 36.

f_n = factor(n)

% Substitute the prime factors 2 and 3 into the product formula.

p_product = n*(1-1/2)*(1-1/3)

%
% Copyright 2019 The MathWorks, Inc.