Preparation of compound 23a: 1H-pyrazol-3-ylamine (32 g, 0.386 mol) and (E)-3-dimethylaminoacrylaldehyde (38.2 g, 0.386 mol) were dissolved in ethanol (500 mL), and the reaction was carried out at reflux for 6 hours. After completion of the reaction, the solvent was removed by distillation under reduced pressure and the resulting residue was purified by column chromatography (eluent: petroleum ether/ethyl acetate = 10:1 to 2:1) to afford the target product, pyrazolo[1,5-a]pyrimidine 23a, as a white solid (30 g, 65% yield).