A palindromic number is an integer that reads the same backwards. The following numbers are examples of palindromic numbers:

6, 55, 282, 5005, 78187, 904409, 3160613, 11111111

There are a lot of palindromic numbers. Moreover, every integer that can't be divided by 10 has an infinite number of multiples that are palindromic. The standard representation of a multiple of 10 can impossibly be palindromic, since its reverse would have a leading zero. 

Assignment

 

Example

>>> palindromic(6)
True
>>> palindromic(1234)
False
>>> palindromic(98786)
False
>>> palindromic(3160613)
True
>>> palindromicmultiples(3, 1)
3
>>> palindromicmultiples(25, 3)
2
>>> palindromicmultiples(12, 4)
7
>>> palindromicmultiples(30, 3)
0
>>> palindromicmultiples(81, 6)
0

Explanation: There are three multiples of 3 with 1 digit: 3, 6 and 9; all integers of 1 digit are by definition palindromic. Of the palindromic numbers that consist of 3 digits, only 525 and 575 are multiples of 25. The palindromic multiples of 12 consisting of 4 digits are 2112, 2772, 4224, 4884, 6336, 6996 and 8448. There are no palindromic numbers that end in a zero, seeing that leading zeroes aren't allowed in integers. Not a single palindromic number of 6 numbers is divisible by 81.