That's a good point, the US population of people 18 years or old is ~252 million, so if you only gave people 18+ a UBI handout, you'd cut your costs to 7.862 Trillion dollars per year.
Also, I suspect the formula you intend is X + max(UBI - X, 0)—or, more simply max(UBI, X). Consider what your formula does for pension < UBI.
A UBI that pays a portion of a living wage might be a very good idea, but it's not going to allow the majority of Americans to lay on their butts all day watching TV and eating cheesy poofs.