A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Write a program that finds the largest palindrome made from the product of two 3-digit numbers.
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Write a program that finds the largest palindrome made from the product of two 3-digit numbers.
Try the code below:
ispalindromic <- function(x) {
return(all(utf8ToInt(x) == rev(utf8ToInt(x))))
}
v <- 100:999
l <- sapply(as.character(outer(v,v)), ispalindromic)
r <- as.numeric(names(tail(which(l),1)))