According to the console output, Phs 1 and 3 start eating and finish.
That afterwards Ph 4,2 and 5 eat should not work, because the mutex semaphores should prevent two adjacent Phs. The semaphores should all be initialized before the Phs start.
Here are some problems.
Fields start with 0 in C, and not with 1, so it can't work like that:
for (i = 1; i <= NUM_CHOPSTICKS; i++) {...}
for (i = 1; i <= NUM_PHILOSOPHERS; i++) {...}
Obviously the first elements are not initialized at all and with some certainty something else is overwritten instead.
There may be delays in the output, since on the one hand the line feed is missing and on the other hand the buffer is not written safely.
printf("\nPhilosopher % d is eating ", n);
use instead
printf("Philosopher %d is eating\n", n);
fflush(stdout);
And the remark of Karsten with %d would also have to be considered.
The idea to cast an integer as a pointer should actually lead to warnings starting from 64Bit. I don't think this is a good idea.
The solution is a naïve approach that does not prevent the same people from eating all the time, nor does it prevent everyone from starving.