I don't think quitting pot is going to have measurable effect on his ability to learn algebra, but it will probably make him miserable if he goes cold turkey having smoked constantly like that.
Also, starting smoking at 16 probably didn't do wonders for his mental prowess.