Take the number 192 and multiply it by each of 1, 2, and 3:

    192 × 1 = 192
    192 × 2 = 384
    192 × 3 = 576

By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the concatenated product of 192 and (1,2,3)

The same can be achieved by starting with 9 and multiplying by 1, 2, 3, 4, and 5, giving the pandigital, 918273645, which is the concatenated product of 9 and (1,2,3,4,5).

What is the largest 1 to 9 pandigital 9-digit number that can be formed as the concatenated product of an integer with (1,2, ... , n) where n > 1?

 

192를 1, 2, 3으로 곱하면 다음과 같다:

    192 × 1 = 192
    192 × 2 = 384
    192 × 3 = 576

각 결과물을 연결시켜 보면 1에서 9 pandigital인 192384576을 구할 수 있다. 192384576을 192와 (1, 2, 3)의 연결된 곱(concatenated product)으로 부른다.

9를 1, 2, 3, 4, 5로 곱해서 연결하면 1에서 9 pandigital인 918273645가 되며, 이것은 9와 (1, 2, 3, 4, 5)의 연결된 곱이다.

1보다 큰 자연수(1, 2, ..., n)으로 만들 수 있는 연결된 곱 중 가장 큰 9자리의 1에서 9 pandigital은 무엇인가?

--------------------------------------------------------------------------

 

문제에서 n을 2 이상으로 한정했기 때문에 5자리 숫자는 최소 10자리가 되어서 1에서 4자리 숫자의 범위 내에서 찾으면 되는 것을 알 수 있다.

 

숫자에 1, 2, 3 등을 차례로 곱하면서 나온 결과물을 연결한 길이가 9인 경우(10 이상이면 다음 숫자로), 9자리 숫자에 1~9까지 숫자가 하나씩 있는지 확인하는 것을 반복하면 된다.  결과로 나온 값을 정렬해서 가장 큰 수를 구하면 되기 때문에 보기 보다는 어렵지 않게 해결할 수 있다.

+ Recent posts