A math minor for computer programmers is more common than any/no minor. It is absolutely beneficial. Moreso for that major than probably any other major.
The only time you'd have to give what you invent to the university is if you have a working agreement with them. Those don't usually last more than a few years after graduating, if it's even mandatory at all. After the contract is up (which is essentially you paying for your education after you receive it, mind you; not them just stealing your shit), you can leave the university if you want and make whatever under your own name. Even though you do still get credit for work you do under a university. It'd just say e.g. "by Flareboy, University of Dicksucking" or something to that effect.
You should be able to take programming classes as a freshman. Aim for scholarships. FAFSA and academic scholarships should be more than enough to get your through college for hardly any more than room and board (which is free if the college is close to your home). Graduate programs (after your Bachelor's) are usually free, which is why they require you work for them. Or I should word it, graduate programs almost always offer an option wherein you can work for them as an alternative to paying tuition/board/etc. fees.
As for scholarships, the only chance I'll have at one is if I develop and sell some really cool computer software and someone starts looking at me. I hate to say it, but I've ruined my highschool GPA. I get too distracted in my classes, they're boring to me. I spend my entire time in my classes either making up complicated problems and solving them, or learning more advanced subjects like calculus and stuff. For example, I had a chemistry class where the teacher would say "1 zoop = 4.5 zips, 1 zip = 17 zaps, 1 zap = 59 uerps" and we would have to figure out how many blank equaled how many blank. The teacher came over to my desk near the end of class and said "323, why is your page completely blank? You're not supposed to be doing other homework" because she saw I was playing with my calculator "Oh, I'm not doing other homework, and I just finished the worksheet. Watch!" and I showed her how I had made algorithms for each program where you could first pick what unit you were translating, whether it be zoops, zips, zaps, or uerps, and then pick what unit you were translating it to. Then you would enter the number of the first unit, and it would give you how many of the second unit it was. Then, using my calculator programs I developed, I finished the worksheet in about 30 seconds. On the test, she used the same formula for all of the problems, so I created an algorithm for the first problem, and finished the test in about two minutes, just inputting values. She got pretty mad at that, we're not allowed to use graphing calculators anymore.
But yeah, so I get distracted in all of my classes, I don't feel they're advanced enough, but I can't focus enough to just test out of them. It's really annoying. I always forget to do homework too, which sucks.
But yeah.