An irrational decimal fraction is created by concatenating the positive integers:
0.123456789101112131415161718192021...
If d(n) represents the nth digit of the fractional part, find the value of the following expression
d(1) × d(10) × d(100) × d(1000) × d(10000) × d(100000) × d(1000000)
from operator import mul
from functools import reduce
def p40():
s = ''.join(str(x) for x in range(1000000)) # trial and error unitl no IndexError
return reduce(mul, [int(s[10 ** i]) for i in range(7)])
210