Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
As suggested by the OP, I post my comment as an answer:
Try out Wolfram Alpha. The code for your example is https://www.wolframalpha.com/input/?i=Sum%5B+k+a+%5Ek+b%5E%28n-k%29+%2C+%7B+k%2C+1%2C+n+%7D+%5D