Need solution to a moderately complex maths problem

@pezzott1 I am having difficulty copying this. Could you provide the blueprint code for it?