problem4 calculates the largest palindrome from the product of two n-digit numbers, being 'n' the giving number of digits

problem4(digits)

Arguments

digits

Number of max digits to run comparison

Value

The result number

Complexity

This function has the following complexity O(n)

See also

https://projecteuler.net/problem=4 for more info about it

Examples

problem4(1)
#> [1] 9
problem4(2)
#> [1] 9009
problem4(3)
#> [1] 906609