A pentaquinone based compound (2a) has been synthesized, which can selectively sense F- ions via fluorescence quenching, while the in situ generated deprotonated species of 2a can recognize Cu2+ ions via a fluorescence enhancement. Derivative 2a can also behave as a sequential logic circuit with chemical inputs from F- and Cu2+ ions.