Which is more affected by weight gain-- upper or lower BP number?

Either or both. Either can go up w/ wt gain; both values are important. Maintaining a healthy body wt, not necessarily "ideal body weight" can improve bp, blood sugar, lipids, and other factors. Remember healthy weight is a range, that gets you out of medical trouble. Be active; don't smoke; drink in moderation, if you must; get rest; have fun; versatile, diet, emphasizing lean, unprocessed and non meat sources.