What's this about?
The question as posed is rather unclear and hard to make sense of. Some investigation (whose details I do not choose to reveal) makes me fairly sure that the situation is as follows:
Akie has been set a challenge -- perhaps as part of a job interview or programming contest? -- of the form "Write a program to do X; here is one example of what doing X entails". But X hasn't been explained very clearly to Akie, and s/he isn't very sure why 14 is the right output for the program given the input specified, and s/he is looking for help.
PSE tends to frown on "please solve this puzzle for me so I can gain from your work", but if we interpret Akie's question as asking for a clearer explanation of what the original question is then that's fine. (One could argue that it's then off-topic, but it's a question about a puzzle and as such might be OK.)
OK, so here is what I am fairly sure the original problem is asking for.
There is an eccentric kind of slot machine. It has some number of wheels; each wheel has some symbols on it, which we represent by the numbers 1 to n for some n. Important note #1: each wheel's symbols consist of all the numbers from 1 to something; we can't have a wheel with just the numbers 1,2,5,9, for instance. Important note #2: n can be different for different wheels.
When you pull the machine's lever, two things happen. The first is that all the wheels get spun, so that one symbol on each wheel is chosen at random. The second is that the wheels are rearranged into a random order. And then, of course, you get to see what the selected symbols are.
Finally, the actual task Akie has been set. The machine has been operated some number of times, and the resulting sequences of symbols (numbers) written down. You have to write a program that takes these sequences, and answers the question "What's the minimum total number of symbols, on all the wheels, of a machine that could produce these results?".
I will not explain how the given results lead to the minimum number of 14; I think working that out is meant to be part of the challenge. But I will run through a much simpler example.
Suppose you have a two-wheel machine and operate it twice, getting the results 13 and 21. How simple can it be?
One obvious solution is that the first wheel has n=2 and the second has n=3. So the first time you get 1/2 and 3/3; the second time you get 2/2 and 1/3. That would give a total of 2+3=5.
But you can do better, because the wheels' order can change. You only need one wheel with n=3 and one with n=1. Then the first time you have 1/1 and 3/3; the second time the wheels are in the other order and you have 2/3 and 1/1.
Obviously you can't do better than that, because at least one n has to be at least 3 and each n has to be at least 1. So this is the best possible, and the answer for this input should be 4.