Unexpected output in pattern problem

i have tried writing the code for this problem but getting some issues in getting the exact output . please tell me how to rectify my code to get the desired output.

there is one small mistake
i<=((n-3/2))
this is wrong
correct one
i<=((n-3)/2)

Modified Code