Hansen and John have kind of a rocky start when they meet at the start of grad school. They are splitting the prestigious Mellon Fellowship, and they are definitely in competition with each other for all the kudos and recognition that geniuses like them hope for in grad school.
So, Hansen seems to try to get the upper hand right away by making John feel like he doesn't even belong at Princeton:
HANSEN: Hey, I'll take another.
JOHN: Excuse me?
HANSEN: A thousand pardons. I simply assumed you were the waiter.
Not very nice, eh? Of course, John doesn't just let the insult stand—he's got his own to offer:
JOHN: Well, Martin Hansen. It is Martin, isn't it?
HANSEN: Why, yes, John, it is.
JOHN: I imagine you're getting quite used to miscalculation. I've read your pre-prints, both of them, one on Nazi ciphers, and the other one on non-linear equations, and I am supremely confident that there is not a single seminal or innovative idea in either one of them. Enjoy your punch.
We don't see much of Hansen, but this early exchange indicates that he's probably rich/privileged, and more than a little smug. Oh, and at least according to John, he's not as smart as he thinks he is.
However, years pass, and when John finds himself trying to get back on his feet after his illness, he ends up deciding that his old grad school colleague might just help him out. He goes to Hansen at Princeton, where the latter is now a professor, to see if his old frenemy will let him use the facilities and kind of, well, hang out and try to get back into his old scholarly community.
Unfortunately, John's hallucinations flare up right as he's gearing up to ask Hansen for this favor, and he gets visibly agitated. However, we can see that Hansen has grown up a lot, because he is totally decent about it:
JOHN: Is there any chance that you could ignore what I just did?
HANSEN: Of course, what are old friends for?
JOHN: Is that what we are, Martin? Friends?
HANSEN: John, of course. Of course. We always have been.
And so, Hansen ends up being totally instrumental in helping John get back to his version of a new normal. It's nice to see a happy ending after that kind of crummy and backstabby start.