#Retina, 36 29 bytes
Retina, 36 29 bytes
7 bytes thanks to Martin Ender.
.+ $* (?!(11+)\1*$(?<=^\1+)). Explanation
There are two stages (commands).
First stage
.+ $* It is a simple regex substitution, converting the input to that many ones.
For example, 5 would be converted to 11111.
Second stage
(?!(11+)\1*$(?<=^\1+)). This regex tries to match the positions which satisfy the condition (co-prime with input), and then return the number of matches.