Calculate int data from an array using recursive functions