what was equation to calculate the aspect ratio in pixels?
For example I have 2.76:1 ratio that I would like calculate with a 3840x2160 resolution.
Wouldn't it be around 3840x1396?

either multiply the height by 2.76 or divide the width by 2.76, whichever number you have. So in this case it's 3840/2.76 = 1391. Probably rounded to 1392 because screen sizes tend to be even numbers.