By copy and paste

First observe that
P(0)+P(1)+...P(999)
and P(1000)+P(1001)+P(1999) is the same except the latter has one more non-zero term P(1000)=1.
Let us define S(1000):= P(0)+P(1)+...P(999),
then P(1)+P(2)+...+P(2009)=2*S(1000)+1+P(2000)+...+P(2009)
=2*S(1000)+1+2*46=2*S(1000)+93.
Now apply the same calculation to S(1000) using S(100):=P(0)+P(1)+...P(99), we have
P(100)+P(101)+...+P(199)=1+S(100)
P(200)+P(201)+...+P(299)=2+2*S(100)
...
P(900)+P(901)+...+P(999)=9+9*S(100)
Summing them up gives,
S(1000)=46*S(100)+45.
Similarly we can get S(100)=46*S(10)+45, but S(10) is simply 45. So the final answer seems to be 194763.

所有跟帖: 

Nice! -亂彈- 給 亂彈 發送悄悄話 亂彈 的博客首頁 (0 bytes) () 10/10/2009 postreply 18:55:26

請您先登陸,再發跟帖!