Problem 020
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
bld
- Posts: 1
- Joined: Sun Nov 20, 2011 1:58 am
Re: Problem 020
158 digits is not a very big number. everyone can solve this but i'm hoping for an amazing solution in the overview.pdf . So i should make my code now (haven't solve this problem yet !)
-
dan_misailescu
- Posts: 4
- Joined: Fri Apr 27, 2012 12:44 am
- Contact:
Re: My Solution Euler Problem 20
This is my first post on this forum so hello everyone!
Salutări din România!
Greetings from Romania!
I'm new to the site, This is only my 15-th solved problem.
I'm happy I solved Project Euler Problem 20 elegantly, and with it I also created a special Project Euler C# Library with Classes that will help me with future Project Euler problems. And as I discover algorithms I want to add to it more and more.
I suggest you do the same so that you don't repeat the same work over and over again.
For now I have the means to sum and multiply numbers however big.
My algorithm for 100! worked in {00:00:00.0619568}
SO ALMOST INSTANTLY
I'm not writing it all, so that you don't directly compute the sum of all the digits on the screen
and input the result on Project Euler.
For maths sake I decided to use it also for computing the monstrous 1000!... It didn't take long, considering how huge the number is. Only {00:03:34.9686380}
The result was this:
snip
I'm sure by now you wonder about the details behind my "misterious" BigNumberClass...
In short, I used the idea to compute the product digit by digit, just like we compute products on a sheet of paper.
The complete code I created is available on ProjectEuler special thread for the problem 20 and you can see it there once you solve it yourself.
I don't want to spoil you the pleasure of solving it yourself
Cheers!
Dan Misailescu
Salutări din România!
Greetings from Romania!
I'm new to the site, This is only my 15-th solved problem.
I'm happy I solved Project Euler Problem 20 elegantly, and with it I also created a special Project Euler C# Library with Classes that will help me with future Project Euler problems. And as I discover algorithms I want to add to it more and more.
I suggest you do the same so that you don't repeat the same work over and over again.
For now I have the means to sum and multiply numbers however big.
My algorithm for 100! worked in {00:00:00.0619568}
SO ALMOST INSTANTLY
I'm not writing it all, so that you don't directly compute the sum of all the digits on the screen
For maths sake I decided to use it also for computing the monstrous 1000!... It didn't take long, considering how huge the number is. Only {00:03:34.9686380}
The result was this:
snip
I'm sure by now you wonder about the details behind my "misterious" BigNumberClass...
In short, I used the idea to compute the product digit by digit, just like we compute products on a sheet of paper.
The complete code I created is available on ProjectEuler special thread for the problem 20 and you can see it there once you solve it yourself.
I don't want to spoil you the pleasure of solving it yourself
Cheers!
Dan Misailescu
Last edited by rayfil on Fri Apr 27, 2012 3:25 am, edited 2 times in total.
Reason: Code nor results should be posted here
Reason: Code nor results should be posted here

- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Problem 020
@ Dan,
You should certainly be proud of your accomplishments. However, please restrict publishing your code and results in the problem threads on the other site. This forum is NOT for that purpose.
You should certainly be proud of your accomplishments. However, please restrict publishing your code and results in the problem threads on the other site. This forum is NOT for that purpose.
When you assume something, you risk being wrong half the time.