Study of periodicities of solar nuclear gamma ray flares and sunspots