It was proven during the previous lecture that
1+2+3+....+n=[n(n+1)]/2.
Using that result, find the sum of all 3-digit palindromes: a palindrome is a number that can be written as ABA, where 1=<A<=9 and 0<=B<=9. Hint: decompose ABA = 100*A + 10*B + A and use above proven result.
Comments
Leave a comment