I am using the below command in Mathematica (an example):
Catch[Do[i; If[EulerPhi[i] > EulerPhi[i + 1], Print[i]], {i, 1, 100}]]
Of course, I would like to do this for other functions (maybe) and for 100 replaced for much bigger numbers.
How to count the number of outputs (printed solutions) for this? Since they appear in a column, I cannot use count commands for table. At least, they are not working for me.
Table
instead ofDo
and useNothing
as the 3rd arg toIf
. And just usei
, notPrint
in the 2nd arg. $\endgroup$Length@Table[If[EulerPhi[i] > EulerPhi[i + 1], i, Nothing], {i, 1, 100}]
. The output of Table can be counted very easy.. $\endgroup$