Project Euler – Prime generating integers

Just a short tip on how to potentially solve this.
Take a close look at the given example number of 30.
All its divisors form a pair: 1 and 30, 2 and 15, 5 and 6, 3 and 10.
If the sum of each individual pair is prime, you found a prime generating integer:

1 + 30 = 31
2 + 15 = 17
5 + 6 = 11
3 + 10 = 13

All prime.

Which is exactly what the problem description states by giving you the formula d + n/d.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s