This compound can be obtained in the following way: 1) The reaction of N,N-dimethyl 4-methoxybenzamide (I) with 2-(methylthio)pyrrole) (II) by means of POCl3 in refluxing dichloromethane gives 5-(4-methoxyhenzoyl)-2-(methylthio)pyrrole (III), which is oxidized with m-chloroperbenzoic acid in dichloromethane to the corresponding sulfone (IV). The condensation of (IV) with 5,5-dimethylene-2,2-dimethyl-1,3-dioxane-4,6-dione (V) by means of NaH in hot DMF affords the intermediate compound (VI), which by methanolysis with methanol and HCl is converted to 5-(4 methoxybenzoy)-1-[3,3-di-(methoxycarbonyl)propyl]-2-(methylsulfonyl)pyrrole (VII). The cyclization of (VII) by means of NaH in hot DMF gives dimethyl-5-(4-methoxybenzoyl)-1,2-dihydro-3H-pyrrolo[1,2-a]pyrrole-1,1-dicarboxylate (VIII), which is finally hydrolyzed and decarboxylated with KOH in refluxing methanol-water.
By condensation of 3-(chloromethyl)pyridine (I) with 2-mercaptopyrimidine (II) in ethanol-water at room temperature.