Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Finding sum of all digits from 1 to 1 million.

by little (Curate)
on Jan 24, 2002 at 00:22 UTC ( [id://141013]=note: print w/replies, xml ) Need Help??


in reply to Re: Finding sum of all digits from 1 to 1 million.
in thread Finding sum of all digits from 1 to 1 million.

mh, ok, repeat after me *grin*:
ALL INTEGERS BIGGER THAN 0 ARE NATURAL NUMBERS !

Have a nice day
All decision is left to your taste
Update:
Uhm ok, seems I got you wrong here.
so did you mean the solution would more look alike
$ perl -e '$sum += length($_) for ( 1..1000000 );print $sum'
But then I ask myself if that question is not much more tricky, cause there are only 10 decimal numbers we use to represent all numbers. So what is teh right answer though?
the result of the above, as it is 5888896 or simply 10?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://141013]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found