how can measure number of photons flux density of different spectral type of stars like O, B, A, F, G, K, M by integrating Planck function with lowest and highest value of energy .What will be the calculated values for number of photons for each spectral type of stars?
I will only outline the method and leave out the exact math or numbers:
From the spectral type you know both the luminosity (thus the integral value over the Planck function). From the spectral type you also get information about the surface temperature, thus the exact shape of the Planck function. Get this for luminosity and surface temperature as function of spectral type from tables or empirical formulas like mass-radius-luminosity relations for main sequence stars.
Apply the knowledge of the surface temperature to interpret the Planck function as a probability density function for the photon flux density. Use the known integral value of the Planck function to convert the probability density to the actual numbers of photons emitted as function of wavelength or frequency.