Solution (source code)

= Solution

<Euler's totient function> counts the <integers> in a complete <complete residue system> that are <coprime> to the modulus:
$$
\boxed{\phi(n)=\#\{1\leq a\leq n:\gcd(a,n)=1\}.}
$$
If the <prime factorization> is $n=\prod_{j=1}^r p_j^{e_j}$ with distinct <prime numbers> $p_j$, <Euler's totient product formula> is
$$
\boxed{\phi(n)=n\prod_{j=1}^r\left(1-\frac1{p_j}\right)
=\prod_{j=1}^r p_j^{e_j-1}(p_j-1).}
$$
In particular, $\phi(2017)=2016$. Adjoining the <prime factor> $2$ changes neither the odd factor nor its count of <units>, since $\phi(2)=1$. The product formula gives
$$
\boxed{n=4034=2\cdot2017,\qquad\phi(4034)=(2-1)(2017-1)=2016.}
$$
This is a positive <integer> distinct from $2017$, as required.