How should I deal with discouragement looking at others success?
I will apologize in advance, because this answer won't give you what you are probably looking for; but it might give some perspective so I will reply anyways hoping that helps somewhat. 

First off, know this: you are not alone! It's actually pretty common to look at your peers (at the office and elsewhere worldwide) and feel shitty about the "insignificance" of your accomplishments compared to those of others. To further strengthen the point, I can say that I am battling with this every single day for instance, despite what I hear from others about the quality or importance of my work when I look around and see what others achieve I feel depressed... 

Secondly it's also good to try and remember that life isn't a competition. Well, some aspects of life are competitive, for sure, but you cannot go about living your day competing with others in every single aspect of your life. This is a simple but a very powerful insight, also very hard to digest it properly and take it to heart. 

Think of all the aspects your life, from research to parking your car, from buying groceries to whatever sport you enjoy the most... I can guarantee you that there will be several (if not more) people within your immediate surrounding that will be "better" than you in each one and single aspect, if you isolate them one at a time. But I can also assure you that they won't be the same people if you consider different aspects. Overall, you are the person you are and constantly comparing yourself to others in single aspects (and focusing on your shortcomings) will only drive you towards unhappiness. 



So does that mean you should just relax and go with the flow? Absolutely not! You have to play catch up, if you can identify your shortcomings in particular fields (like maths, or programming experience). It'll be frustration, it'll be long hours, it'll be effort... Try to focus on setting goals for yourself when you are in catch-up phase. 

I strongly recommend checking out S.M.A.R.T goals concept which helps in getting things done and bagging that sweet feeling of accomplishment, little by little. 

Hope this answer helps to some extent and it all works out in the end!