Page **1** of **1**

### Problem 521

Posted: **Fri Jul 24, 2015 8:58 am**

by **DeatH_StaR**

Hi all,

Can problem 521 be solved by the "one minute rule"?

Just *counting* to 10^{12} took me on a fast computer more then 15 minutes (not finding primes, just counting).

So will I need to expect a slow solution, or am I missing something that will enable me to solve it fastly?

### Re: Problem 521

Posted: **Fri Jul 24, 2015 9:31 am**

by **TripleM**

Every problem satisfies the 1 minute rule. If you can't count to 10^12 in one minute, then clearly you shouldn't be trying to

### Re: Problem 521

Posted: **Fri Jul 24, 2015 10:20 am**

by **DeatH_StaR**

Thanks, I got worried...

### Re: Problem 521

Posted: **Sun Jul 26, 2015 12:55 am**

by **v6ph1**

Even if you can not count from 1 to 10^12 within the 1 minute rule, it is possible to get the sum of all these numbers within less than 1 minute.

The same is true for some number theoretic functions.

So you may calc that sum in a different way.

-- v6ph1

PS: Simply sieving needs around 7 hours on a modern i7 CPU.

### Re: Problem 521

Posted: **Sun Jul 26, 2015 6:17 pm**

by **Marcus_Andrews**

DeatH_StaR wrote:Hi all,

Can problem 521 be solved by the "one minute rule"?

Just *counting* to 10^{12} took me on a fast computer more then 15 minutes (not finding primes, just counting).

So will I need to expect a slow solution, or am I missing something that will enable me to solve it fastly?

We don't release problems unless we can confirm they are solvable in under a minute:

https://projecteuler.net/about
**I've written my program but should it take days to get to the answer?**

Absolutely not! Each problem has been designed according to a "one-minute rule", which means that although it may take several hours to design a successful algorithm with more difficult problems, an efficient implementation will allow a solution to be obtained on a modestly powered computer in less than one minute.

### Re: Problem 521

Posted: **Tue Nov 13, 2018 3:57 am**

by **vamsikal3**

Can someone verify the answer for n = 201820182018 is <snipped by modrator>? Thanks!

### Re: Problem 521

Posted: **Tue Nov 13, 2018 8:07 am**

by **philiplu**

vamsikal3 wrote: ↑Tue Nov 13, 2018 3:57 am

Can someone verify the answer for n = 201820182018 is <snipped by moderator>? Thanks!

Those are the correct final 9 digits.

### Re: Problem 521

Posted: **Tue Nov 13, 2018 9:50 am**

by **vamsikal3**

Thanks for verifying the result. philiplu, are you <snipped by moderator>? This blog was helpful in solving PE problems.

### Re: Problem 521

Posted: **Wed Nov 14, 2018 3:17 am**

by **kenbrooker**

Ahhh... Silly me... I thought --

"This forum is not meant to publish solutions."

"In particular don't post any ... **results**."

### Re: Problem 521

Posted: **Wed Nov 14, 2018 9:45 am**

by **yourmaths**

There are plenty of test solutions in these forums... maybe the rule needs to be clarified?