I would like to know what are the exact solutions for the equation $x-\phi(x) = k$, where $\phi$ is the totient function and $k$ is equal to $167$, a highly cototient number.
I was told there are $15$ solutions to this equation. Any advice on these solution or how to solve this problem in MapleSoft or using Python? Thanks.
The following Mathematica program takes a second or two to produce the output below.
$\text{Block}[\{x=1,n=1,\text{outList}=\{\}\},\text{While}[n\leq 15,\text{If}[x-\phi (x)=167,\text{outList}=\text{AppendTo}[\text{outList},\{n,x\}];n\text{++}];x\text{++}];\text{Grid}[\text{outList}]]$
$\begin{array}{cc} 1 & 455 \\ 2 & 815 \\ 3 & 1727 \\ 4 & 2567 \\ 5 & 2831 \\ 6 & 4031 \\ 7 & 4247 \\ 8 & 4847 \\ 9 & 5207 \\ 10 & 6431 \\ 11 & 6527 \\ 12 & 6767 \\ 13 & 6887 \\ 14 & 7031 \\ 15 & 27889 \\ \end{array}$
Recalling $\phi(x)=x\prod\limits_{p|x}\left(1-\frac{1}{p}\right)$, the following Mathematica program and subsequent output perhaps provides a bit more insight.
$\text{Block}\left[\left\{n=1,x=1,\text{outList}=\left( \begin{array}{cccccc} \text{n} & \text{x} & \text{xFactors} & \text{yList} & \text{x Product[m,$\{$m,yList$\}$]} & \text{x-167} \\ \end{array} \right),\text{xFactors},\text{yList}=\{\}\right\},\text{While}\left[n\leq 15,\text{If}\left[x-\phi (x)=167,\text{xFactors}=\text{FactorInteger}[x];\text{yList}=1-\frac{1}{\text{First}\text{/@}\text{FactorInteger}[x]};\text{outList}=\text{AppendTo}\left[\text{outList},\left\{n,x,\text{xFactors},\text{yList},x \prod _m^{\text{yList}} m,x-167\right\}\right];n\text{++}\right];x\text{++}\right];\text{Grid}[\text{outList}]\right]$
$\left( \begin{array}{cccccc} \text{n} & \text{x} & \text{xFactors} & \text{yList} & \phi(x)=x\prod\limits_{m\in\text{yList}} m & \phi(x)=x-167 \\ 1 & 455 & \left( \begin{array}{cc} 5 & 1 \\ 7 & 1 \\ 13 & 1 \\ \end{array} \right) & \left\{\frac{4}{5},\frac{6}{7},\frac{12}{13}\right\} & 288 & 288 \\ 2 & 815 & \left( \begin{array}{cc} 5 & 1 \\ 163 & 1 \\ \end{array} \right) & \left\{\frac{4}{5},\frac{162}{163}\right\} & 648 & 648 \\ 3 & 1727 & \left( \begin{array}{cc} 11 & 1 \\ 157 & 1 \\ \end{array} \right) & \left\{\frac{10}{11},\frac{156}{157}\right\} & 1560 & 1560 \\ 4 & 2567 & \left( \begin{array}{cc} 17 & 1 \\ 151 & 1 \\ \end{array} \right) & \left\{\frac{16}{17},\frac{150}{151}\right\} & 2400 & 2400 \\ 5 & 2831 & \left( \begin{array}{cc} 19 & 1 \\ 149 & 1 \\ \end{array} \right) & \left\{\frac{18}{19},\frac{148}{149}\right\} & 2664 & 2664 \\ 6 & 4031 & \left( \begin{array}{cc} 29 & 1 \\ 139 & 1 \\ \end{array} \right) & \left\{\frac{28}{29},\frac{138}{139}\right\} & 3864 & 3864 \\ 7 & 4247 & \left( \begin{array}{cc} 31 & 1 \\ 137 & 1 \\ \end{array} \right) & \left\{\frac{30}{31},\frac{136}{137}\right\} & 4080 & 4080 \\ 8 & 4847 & \left( \begin{array}{cc} 37 & 1 \\ 131 & 1 \\ \end{array} \right) & \left\{\frac{36}{37},\frac{130}{131}\right\} & 4680 & 4680 \\ 9 & 5207 & \left( \begin{array}{cc} 41 & 1 \\ 127 & 1 \\ \end{array} \right) & \left\{\frac{40}{41},\frac{126}{127}\right\} & 5040 & 5040 \\ 10 & 6431 & \left( \begin{array}{cc} 59 & 1 \\ 109 & 1 \\ \end{array} \right) & \left\{\frac{58}{59},\frac{108}{109}\right\} & 6264 & 6264 \\ 11 & 6527 & \left( \begin{array}{cc} 61 & 1 \\ 107 & 1 \\ \end{array} \right) & \left\{\frac{60}{61},\frac{106}{107}\right\} & 6360 & 6360 \\ 12 & 6767 & \left( \begin{array}{cc} 67 & 1 \\ 101 & 1 \\ \end{array} \right) & \left\{\frac{66}{67},\frac{100}{101}\right\} & 6600 & 6600 \\ 13 & 6887 & \left( \begin{array}{cc} 71 & 1 \\ 97 & 1 \\ \end{array} \right) & \left\{\frac{70}{71},\frac{96}{97}\right\} & 6720 & 6720 \\ 14 & 7031 & \left( \begin{array}{cc} 79 & 1 \\ 89 & 1 \\ \end{array} \right) & \left\{\frac{78}{79},\frac{88}{89}\right\} & 6864 & 6864 \\ 15 & 27889 & \left( \begin{array}{cc} 167 & 2 \\ \end{array} \right) & \left\{\frac{166}{167}\right\} & 27722 & 27722 \\ \end{array} \right)$