It’s frustratingly complicated to calculate. I want it to be easier. You can probably assume it’s cheaper to heat via mining, unless your miner is quite inefficient. What that cutoff is depends on your local electricity to natural gas price ratio and the miner’s efficiency.
Then you need to take into account the fact that you probably already have the natural gas heating equipment but you don’t have the mining equipment