A huperzine A compound is provided. The huperzine A compound has following formula:wherein X comprises O or S, Y comprises —O—, —S—, —CH(R4)—, —C(R4)(R5)—, —C(R4)═C(R5)—, —C≡C—, —NH— or —N(R4)—, n is 0, 1 or 2, R3 is C(═X)—(Y)n—R1 provided that R2 is H or R2 and R3 are combined to form ═CH—Ar, wherein R1, R4 and R5 independently comprise hydrogen, C1-C32 alkyl, C1-C32 alkenyl, C1-C32 alkynyl, C1-C32 aryl or C1-C32 heteroaryl, in which alkyl, alkenyl, alkynyl, aryl or heteroaryl with one or more substituents comprising halogen, hydroxyl, alkoxy, aryloxyl, amino, alkylamino, arylamino, dialkylamino, diarylamino, imino, alkylimino, arylimino, acylamido, diacylamido, acylimido, cyano, nitro, mercapto, carbamido, carbamoyl, carboxyl, thioureido, thiocyanato, sulfonamido, thio, sulfonyl or sulfinyl, and Ar comprises aryl or heteroaryl.