Find common value in 2 arrays

Igor

New member
Joined
Nov 24, 2020
Messages
1
Hi!

I want to know what the common value is for both array 'a cumulative' and 'b cumulative'.

I have the following information:
a = 3,5
b = 3
c = ?

a cumulativeb cumulative
3,5​
3​
7​
6​
10,5​
9​
14​
12​
17,5​
15​
21​
18​
24,5​
21​

As you can see c has the value 21, since 6 * 3,5 = 21 and 7 * 3 = 21.

However, what if you cannot see it, how to determine the factors (integers) of a and b to get to this common value ?

Any suggestions? Kind regards, Igor
 
I think you are looking for the smallest number that is in both sequences; that is, it must be a multiple of both 3.5 and 3.

That is called the least common multiple; perhaps you know how to find that for two integers, but are asking how to do it for non-integers?

In this example, since any multiple of 3 is an integer, the LCM must be a multiple of 2*3.5 = 7, the smallest integer multiple of 3.5. So the answer is the LCM of 7 and 3, which is 21.

Is that what you need?
 
Top