Here we are given d-ary..
We need to find the jth child of ith node.
Before coming to the 1st child of the ith node, all the nodes starting from root to the last child of (i-1)th node has to be covered.
Indexing starts from 1.
Last child of A[1] is at index : 1+d
Last child of A[2] is at index : (1+d) + d =1 +2d
Last child of A[3] is at index : ((1+d) + d) + d =1 + 3d
Last child of A[k] is at index : (1+d) + (k-1)d =d+1+kd-d= 1 +kd
So, last child of A[i-1] is at index : 1+ (i-1)d
We have reached the last child of the (i-1)th node.
Now we need to find jth child of the ith node. So simply add j it becomes d(i-1) + j + 1