

'''simple docstring'''

from math import cos, sin, sqrt, tau

from audio_filters.iir_filter import IIRFilter

def 					__UpperCamelCase				(						lowercase__    :	int,       lowercase__    :	int,       lowercase__    :	float = 1 / sqrt(2			)			):






     '''simple docstring'''





     __lowercase      		=tau * frequency / samplerate
     __lowercase      		=sin(lowercase__			)
     __lowercase      		=cos(lowercase__			)
     __lowercase      		=_sin / (2 * q_factor)

     __lowercase      		=(1 - _cos) / 2
     __lowercase      		=1 - _cos

     __lowercase      		=1 + alpha
     __lowercase      		=-2 * _cos
     __lowercase      		=1 - alpha

     __lowercase      		=IIRFilter(2			)
     filt.set_coefficients([aa, aa, aa],       [ba, ba, ba]			)
     return filt

def 					__UpperCamelCase				(						lowercase__    :	int,       lowercase__    :	int,       lowercase__    :	float = 1 / sqrt(2			)			):






     '''simple docstring'''





     __lowercase      		=tau * frequency / samplerate
     __lowercase      		=sin(lowercase__			)
     __lowercase      		=cos(lowercase__			)
     __lowercase      		=_sin / (2 * q_factor)

     __lowercase      		=(1 + _cos) / 2
     __lowercase      		=-1 - _cos

     __lowercase      		=1 + alpha
     __lowercase      		=-2 * _cos
     __lowercase      		=1 - alpha

     __lowercase      		=IIRFilter(2			)
     filt.set_coefficients([aa, aa, aa],       [ba, ba, ba]			)
     return filt

def 					__UpperCamelCase				(						lowercase__    :	int,       lowercase__    :	int,       lowercase__    :	float = 1 / sqrt(2			)			):






     '''simple docstring'''





     __lowercase      		=tau * frequency / samplerate
     __lowercase      		=sin(lowercase__			)
     __lowercase      		=cos(lowercase__			)
     __lowercase      		=_sin / (2 * q_factor)

     __lowercase      		=_sin / 2
     __lowercase      		=0
     __lowercase      		=-ba

     __lowercase      		=1 + alpha
     __lowercase      		=-2 * _cos
     __lowercase      		=1 - alpha

     __lowercase      		=IIRFilter(2			)
     filt.set_coefficients([aa, aa, aa],       [ba, ba, ba]			)
     return filt

def 					__UpperCamelCase				(						lowercase__    :	int,       lowercase__    :	int,       lowercase__    :	float = 1 / sqrt(2			)			):






     '''simple docstring'''





     __lowercase      		=tau * frequency / samplerate
     __lowercase      		=sin(lowercase__			)
     __lowercase      		=cos(lowercase__			)
     __lowercase      		=_sin / (2 * q_factor)

     __lowercase      		=1 - alpha
     __lowercase      		=-2 * _cos
     __lowercase      		=1 + alpha

     __lowercase      		=IIRFilter(2			)
     filt.set_coefficients([ba, ba, ba],       [ba, ba, ba]			)
     return filt

def 					__UpperCamelCase				(						lowercase__    :	int,       lowercase__    :	int,       lowercase__    :	float,       lowercase__    :	float = 1 / sqrt(2			),       ):






     '''simple docstring'''





     __lowercase      		=tau * frequency / samplerate
     __lowercase      		=sin(lowercase__			)
     __lowercase      		=cos(lowercase__			)
     __lowercase      		=_sin / (2 * q_factor)
     __lowercase      		=10 ** (gain_db / 40)

     __lowercase      		=1 + alpha * big_a
     __lowercase      		=-2 * _cos
     __lowercase      		=1 - alpha * big_a
     __lowercase      		=1 + alpha / big_a
     __lowercase      		=-2 * _cos
     __lowercase      		=1 - alpha / big_a

     __lowercase      		=IIRFilter(2			)
     filt.set_coefficients([aa, aa, aa],       [ba, ba, ba]			)
     return filt

def 					__UpperCamelCase				(						lowercase__    :	int,       lowercase__    :	int,       lowercase__    :	float,       lowercase__    :	float = 1 / sqrt(2			),       ):






     '''simple docstring'''





     __lowercase      		=tau * frequency / samplerate
     __lowercase      		=sin(lowercase__			)
     __lowercase      		=cos(lowercase__			)
     __lowercase      		=_sin / (2 * q_factor)
     __lowercase      		=10 ** (gain_db / 40)
     __lowercase      		=(big_a + 1) - (big_a - 1) * _cos
     __lowercase      		=(big_a + 1) + (big_a - 1) * _cos
     __lowercase      		=(big_a - 1) - (big_a + 1) * _cos
     __lowercase      		=(big_a - 1) + (big_a + 1) * _cos
     __lowercase      		=2 * sqrt(lowercase__			) * alpha

     __lowercase      		=big_a * (pmc + aaa)
     __lowercase      		=2 * big_a * mpc
     __lowercase      		=big_a * (pmc - aaa)
     __lowercase      		=ppmc + aaa
     __lowercase      		=-2 * pmpc
     __lowercase      		=ppmc - aaa

     __lowercase      		=IIRFilter(2			)
     filt.set_coefficients([aa, aa, aa],       [ba, ba, ba]			)
     return filt







def 					__UpperCamelCase				(						lowercase__    :	int,       lowercase__    :	int,       lowercase__    :	float,       lowercase__    :	float = 1 / sqrt(2			),       ):






     '''simple docstring'''





     __lowercase      		=tau * frequency / samplerate
     __lowercase      		=sin(lowercase__			)
     __lowercase      		=cos(lowercase__			)
     __lowercase      		=_sin / (2 * q_factor)
     __lowercase      		=10 ** (gain_db / 40)
     __lowercase      		=(big_a + 1) - (big_a - 1) * _cos
     __lowercase      		=(big_a + 1) + (big_a - 1) * _cos
     __lowercase      		=(big_a - 1) - (big_a + 1) * _cos
     __lowercase      		=(big_a - 1) + (big_a + 1) * _cos
     __lowercase      		=2 * sqrt(lowercase__			) * alpha

     __lowercase      		=big_a * (ppmc + aaa)
     __lowercase      		=-2 * big_a * pmpc
     __lowercase      		=big_a * (ppmc - aaa)
     __lowercase      		=pmc + aaa
     __lowercase      		=2 * mpc
     __lowercase      		=pmc - aaa

     __lowercase      		=IIRFilter(2			)
     filt.set_coefficients([aa, aa, aa],       [ba, ba, ba]			)
     return filt





'''simple docstring'''

from collections import defaultdict
from math import gcd

def 					__UpperCamelCase				(						lowercase__    :	int = 1_50_00_00			):






     '''simple docstring'''





     __lowercase      		=defaultdict(lowercase__			)
     __lowercase      		=2
     while 2 * euclid_m * (euclid_m + 1) <= limit:
          for euclid_n in range((euclid_m % 2) + 1,       lowercase__,       2			):
               if gcd(lowercase__,       lowercase__			) > 1:
                    continue
               __lowercase      		=2 * euclid_m * (euclid_m + euclid_n)
               for perimeter in range(lowercase__,       limit + 1,       lowercase__			):
                    frequencies[perimeter] += 1
          euclid_m += 1
     return sum(1 for frequency in frequencies.values() if frequency == 1			)


if __name__ == "__main__":
       print(F'''{solution() = }''')


