Hecke's theorem in quadratic reciprocity, finite nilpotent groups and the cooley-tukey algorithm