These are the nitrogen fixer Cyanobacteria (Blue green algae) under order Nostocales. They have this ability due to a specialized cell, known as Heterocyst.
Heterocyst identification key Features with respect to vegetative cells.
Thick walled.
Weak pigmentation.
Present at both intercalary and terminal position.
Intercalary Heterocyst have Polar granules at each pole while Terminal Heterocyst have polar granule at single pole.