An irrational decimal fraction is created by concatenating the positive integers:

0.123456789101112131415161718192021...

It can be seen that the 12th digit of the fractional part is 1.

If dn represents the nth digit of the fractional part, find the value of the following expression.

d1 × d10 × d100 × d1000 × d10000 × d100000 × d1000000

 

무리수인 10진 분수는 양의 정수를 연결하여 만들어진다:

0.123456789101112131415161718192021...

분수 부분의 12번째 자리 숫자는 1이다.

만약 dn 이 분수의 n번째 자릿수를 나타낸다면, 다음 표현식의 값을 구하시오.

d1 × d10 × d100 × d1000 × d10000 × d100000 × d1000000

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

 

위 특성을 가지는 숫자를 문제 제목인 챔퍼나운 수(Champernowne's constant)라고 부른다고 한다.

 

1부터 계속 커지는 숫자를 붙여나가는 문자열을 만들면서 1, 10, 100, 1000, 10000, 100000, 1000000번째 숫자를 구하고 그 값을 모두 곱하면 되는 문제이다. 구현하는 방법은 다양하겠지만 프로젝트 오일러 문제를 차례대로 풀어왔다면 그렇게 어렵지 않게 해결 가능한 문제이다.

+ Recent posts