#P11996. Sum of Distinct Products of Leading Digits in Powers of 2 and 5

    ID: 14098 Type: Default 1000ms 256MiB

Sum of Distinct Products of Leading Digits in Powers of 2 and 5

Sum of Distinct Products of Leading Digits in Powers of 2 and 5

For any positive integer \(n\), define \(a_n\) as the most significant (leftmost) nonzero digit of \(2^n\) in its decimal representation, and \(b_n\) as the most significant nonzero digit of \(5^n\). For example, when \(n=1\), we have \(2^1=2\) so \(a_1=2\) and \(5^1=5\) so \(b_1=5\), and indeed $$2\times5=10$$.

Your task is to compute the sum of all distinct possible values of \(a_n\times b_n\) over all positive integers \(n\). Note that if a value occurs for multiple \(n\), it should be counted only once. (Hint: The answer is a constant value not dependent on any input.)

inputFormat

This problem does not require any input.

outputFormat

Output a single integer: the sum of all distinct possible values of \(a_n\times b_n\).

sample

dummy
45