It appears you're building a max-heap, where every element is greater than or equal to its child elements (if any). With that understanding, let's trace the action. First, the parent node of $A[j]$ will be $A[j/2]$ (integer division: discard any remainder) so we'll have
j & 1 & 2 & 3 & 4 & 5 & 6 & 7 & \dotsc\\
parent(j) & \_ & 1 & 1 & 2 & 2 & 3 & 3 & \dotsc
To keep things simple, we'll let the initial array be $[3,4,5,13]$:
Insert at $i=2$.
$A[parent(2)]=A=3 < 4=A$ so we swap $A$ and $A$, giving us the array
Insert at $i=3$.
$A[parent(3)]=A=4 < 5=A$ so we swap $A$ and $A$, giving us the array
Insert at $i=4$.
$A[parent(4)]=A=3 < 13=A$ so we swap $A$ and $A$, giving us the array
and now $j=parent(4)=2>1$ so we see if we need another swap.
$A[parent(2)]=A=5 < 13=A$ so we swap $A$ and $A$, giving us the array
and we're done, the array is now a max-heap.
The runtime of this algorithm is no worse than a multiple of $n\log n$ since none of the elements are further than $\log_2n$ from the root at $i=1$ so you'll need at most $\log n$ swaps for each of the $n$ elements. This, by the way, is not as good as possible: there's different algorithm that builds a heap in no more than a multiple of $n$ time.