The density dependence and the range of effective projectile-nucleon interaction from optical model analysis