it would be an invalid patent (or at least should be), because
1. There is prior art
2. it is obvious to a domain expert
But given the US patent office's track record, I wouldn't be too surprised if you were able to get a patent. Just don't expect it to hold up in court.
Patents on software are not that simple - it needs to describe an entire physical system that gives value to a user, not just an abstract function that does computation.