Calculate Kaprekar-Konstante/Routine: Where is my mistake?

Hi all,

I am uncertain if this rather mathematical question belongs here so please allow me to explain it first.

In an effort to evaluate a system performance to find / suggest ideal settings for Knime (memory utilization, parallelization etc.), I had the idea to use reproducible mathematical solutions.

Hi, this might be more a general question. There is a setting about multiple threads for all nodes. [image] When executing a rather compute intensive task, I notices my 16 Core 32 Thread AMD Ryzen 7950X barely moved the pinky. [image] Using five threads via Parllel Start / End Nodes improved CPU utilization as expected. [image] The question is, how does the setting about “Maximum working threads for all nodes” get’s determined and how does it work / scale with the parallel start / end …

One example which caught my interest today, that can be rather CPU straining, is calculating the Keprekar Constant / Routine (Wikipedia english / german).

However, after computing the results for all four digit numbers which meet the initial criteria, I noticed some deviation about which I kindly like to ask if any of you spot the mistake.

The total count of valid numbers which is 8991 is met. The max. count of iterations to calculate the Keprekar constant is also seven, hence met. However, the calculated constant 6741 is met too but only for most of the numbers. For about 68 the result is zero.

Furthermore, counting the amount of numbers per iteration mostly met the criteria too but one bin, the one for five iterations, deviates.

| Iteration | Expectation | Count*(Current Number) | Criteria met |
| 1         | 357         | 357                    | ok           |
| 2         | 519         | 519                    | ok           |
| 3         | 2124        | 2124                   | ok           |
| 4         | 1124        | 1124                   | ok           |
| 5         | 1311        | 1379                   | FAIL         |
| 6         | 1508        | 1508                   | ok           |
| 7         | 1980        | 1980                   | ok           |

Neither Wikipedia nor Google could help me understand this. Does any of you?

Here is my workflow.

hub.knime.com

Many thanks in advance

Mike