I recommend you to run your program through a debugger. Set a breakpoint on line 5 and print the content of the array.
At the starting point the array is filled with 1, so you can simplify the expresion to arr[j] += arr[1];
Now, arr[1] starts with 1, but the function modifies to 2.
You end up having