Suppose we are given two strings and . We want to devise a function that tells us how close the two strings are. A reasonable measurement would be to measure how many "edits" operations have to be made to one string in order to change it to the other. There are three possible "edit" operations:
Substitution: Replacing a single character from so that it matches costs . If and . Then .
Insertion: Inserting a single character also costs . Ie, If and , then .
Deletion: Deleting a single character also costs . Ie. If and then .
Given and , compute .
Let the reverse of a positive integer , denoted be the result when the digits of the number are written backwards; for example, or just
Call a positive integer brilliant if
is a multiple of 13. Let be the th brilliant number. Compute the last three digits of
A palindromic-prime or PalPrime is a prime number that is also a palindrome.The first few PalPrimes are . Let be the sum of the digits of the largest PalPrime such that .What is the value of ?