ne555 40khz circuit
In circuits like that there is no "formula" as a such ..
For example, resistors R4 and R5 are used to set 1/2 of the supply voltage at the inverting input of the comparator .. Almost any values of resistors will work correctly - you can use 1kΩ, 10kΩ, or as in this example 100kΩ ..
Instead of fixed resistors you may consider a 100kΩ potentiometer which will allow you to set the sensitivity of this receiver ..
All other values are not critical, too .. If you select R2=1kΩ you can lower the value of R3 to, say, 200kΩ .. and so on ..
Regards,
IanP