Solution:
The answer is 210. Let us consider all the 4-digit codes that can be formed with digits belonging to the correct intervals (without restrictions on the sum); these number 7⋅4⋅5⋅3=420. We now show that exactly half of these codes also satisfies the condition on the sum of the digits. We observe that if [a,b,c,d] are 4 digits in the indicated intervals, then the same is true for [6−a,3−b,4−c,2−d]; we say that the second code is the companion of the first. The sum of the digits of [6−a,3−b,4−c,2−d] is 15−(a+b+c+d), which is greater than or equal to 8 if and only if a+b+c+d≤7; in particular, exactly one of the two codes [a,b,c,d] and [6−a,3−b,4−c,2−d] satisfies the hypothesis on the sum of the digits. Observing furthermore that the companion of the code [6−a,3−b,4−c,2−d] is again [a,b,c,d], we have thus formed 210 pairs, each of which contains exactly one code compatible with Eugenia's memories.