Recursive-formula for second-harmonic generation problem in photonic hypercrystal