• Counting problem


Recently I came upon this problem and also developed an inefficient algo for it...but the values are so large it's nearly impossible to calculate with my algo...I think u can help...here's the statement A normal long tally counter has 7 digits and counts 1 by 1 , hence there are 1000000 different numbers can be shown on it (in range 0000000 to 9999999 ).

Suppose you have an odd long tally counter. Instead 1 by 1, it counts x by x. In case of overflow, the counter only shows the last digits of the number.

For example, if x = 1000001 the counter will show these numbers : 1000001,2000002,3000003,......,0000010,10000010....

Let F(n) be the function returning the number of different numbers can be shown on odd long tally counter with x = n, find the last digits of the sum of all possible F(n) as n varies from 1 to 10^7-1.