On the Distinct Periodicities of Sunspot Counts in Flaring and Non-flaring Active Regions