The problem with this ~100% efficiency is that, if your goal is heating, you can move way more than 100% heat with 100% electrical energy if you use, say, a heat pump.
First, transporting heat as opposed to electricity is very wasteful, so you only want to transport it in very short distances.
Second, typically even small single family home requires quite large volume to store the heat effectively for many months. It isn't that complex only because in a single family home setting you already have a bunch of uncontested land available so you can use the volume that is relatively flat and not too deep.
Building this on a scale of a city would be insurmountable challenge. You would have to dig deeper than the buildings are high and any kind of works like that are difficult in urban areas.
https://en.wikipedia.org/wiki/Heat_pump
The first sentence:
"A heat pump is a device that transfers heat energy from a source of heat to what is called a thermal reservoir."
So yes, it involves energy storage.
The way this works is you store heat in the summer (warm up a lot of rock or ground underneath your house) and recover that energy in the winter by pumping a liquid through warm rock back to your house and use it as a heat source.
> While air conditioners and freezers are familiar examples of heat pumps, the term "heat pump" is more general and applies to many heating, ventilating, and air conditioning (HVAC) devices used for space heating or space cooling.
Basically what I would understand from the term heat pump in ordinary conversation would be an air conditioner intended for use in a heating dominated climate rather than a cooling dominated one, but there might be some regional differences in usage.
You can use geothermo (ground) to work around this. I'd recommend it, but the one time install costs mean it is questionable if it is cost effective.
But alas, it has to be said.
No, you can't create perpetuum mobile ie. build a machine that given a supply of energy produces as much or even more energy.
Assume your datacenter runs at 50C (122F) and the temperature outside is -40C (-40F), using the datacenter heat to generate electricity has theoretical maximum efficiency of 27.85%. If your datacenter is at 23C (73F) and room temp is 0C (32F), then the theoretical maximum is 7.77%. Note the word 'theoretical maximum', in reality probably at least 10 times worse than that.
Newer generations of CPUs are going to be exchange less frequently but will produce more energy as they offer more dense computing. This makes case for investing more in the server hardware.
Even then understand, that 7% of a huge amount of energy is still huge amount of energy.
Edit: Apparently "Facebook datacenter in Denmark is supplying around 10.000 homes with heating" -- source, another poster.
So... you need to rethink your expertise on defining what is and what is not viable.
If you calculate 1000 digits of pi, those digits will not embody any energy.