Hotelling type duopoly and oligopoly