Without loss of generality take the edges of the octahedron as 2 units. Consider the square-based pyramid forming half the octahedron with the 'special' vertex, let's call this V, as the vertex of this pyramid. Then the plane of symmetry cutting through V and the two coloured faces, cuts the pyramid in an isosceles triangle with sides Ö3, Ö3 and 2.

Now imagine the 'ring' of octahedra glued together! The plane of symmetry for the ring contains the plane of symmetry of the pyramid just described.

The angle at V in this plane of symmetry (to 3 decimal places) is
2sin-11/Ö3 = 70.529o .
So there is 'room' for 360/70.529 = 5.1 octahedra in the ring. Clearly this means the fifth octahedron can be fitted in but no more so the answer is 5.