Skip to main content
Bumped by Community user
Formatted code
Source Link
MarcoB
  • 67.7k
  • 18
  • 96
  • 198

I am using the below command in Mathematica (aan example):

Catch[Do[i; If[EulerPhi[i] > EulerPhi[i + 1], Print[i]], {i, 1, 100}]]

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.

The question is: howHow 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.

Any hint?

I am using the below command in Mathematica (a 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.

The question is: 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.

Any hint?

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.

Source Link
Jean
  • 143
  • 3

How to count outputs in Catch command by using Mathematica

I am using the below command in Mathematica (a 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.

The question is: 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.

Any hint?