Localized electronic states in a ternary quasiperiodic model