Coresilience (source code)

= Coresilience
{title2=$C(n)$}

For an <integer> $n>1$, the <coresilience> is
$$
C(n)=\frac{n-\varphi(n)}{n-1},
$$
where $\varphi$ is <Euler's totient function>.<Project Euler problem 245>[Definition of $C(n)$ and the following prime-value formula]{ref} It is related to the <resilience of a denominator> $R(n)=\varphi(n)/(n-1)$, but is not its complement:
$$
C(n)=1-R(n)+\frac1{n-1}.
$$
For a <prime number> $p$, $R(p)=1$ but $C(p)=1/(p-1)$, rather than zero. For the <composite number> fifteen, $\varphi(15)=8$ and $C(15)=7/14=1/2$.

As $n-\varphi(n)>0$, the value is a <unit fraction> precisely when $n-\varphi(n)$ divides $n-1$. A composite <prime power> $n=p^k$ with $k\geq2$ cannot qualify: its value is $p^{k-1}/(p^k-1)$, already a <reduced fraction> with <numerator> greater than one. This excludes an entire family of <composite numbers> before a search.