I have come to like math better than coding. Maybe because I am a beginner in both coding and math, I prefer taking math proofs apart and playing around with them to seeing some trivial piece of code do some trivial thing.
I'd like to explore the mathematical side of programming using pen and paper. Are there any books that deal with programming problems in mathematical setting? Or what would be the branch of knowledge that studies coding or generally computer science problems purely from math standpoint?
Thanks.
The theory of algorithm analysis and design has a large portion which is quite pure mathematics. There are plenty of hard and open questions related to computability and complexity (other than the famous $P=NP$ problem).
More on the side of the foundations of computation, logic (e.g., Turing machines) is strongly related to imperative programming languages while $\lambda $-calculus is related to functional programming.
Finally, the general theory of programming languages design and analysis is strongly related to category theory.
These are several routes you can try to take that, I hope, will answer your question.