Need help solving Project Euler 200

I am trying to formulate an algorithm to solve Project Euler Problem 200 .

We determine that sbb will be a number of the form, p 2 q 3 where p and q are different primes. For example, 200 = 5 2 2 3 or 120072949 = 23 2 61 3 .

The first five pluses are 72, 108, 200, 392 and 500.

Interestingly, 200 is also the first number for which you cannot change a single digit to make prime; we will call such numbers first-class. The following is simple proof that contains the continuous substring "200" 1992008.

Find the 200th prime zoom containing the continuous substring "200".

Can someone point me in the right direction to help me solve this problem?

0
source share
1 answer

I'm not sure this is a great SO question, but this should start at least.

Algorithmic approach of brute force and ignorance to this should be quite simple:

  • Start with a set of primes P
  • Generate squbes by looking at all ordered pairs (p1, p2) with p1, p2 in P
  • Order this list, call set S (think: how can you do this when creating them)
  • Check each s in S in turn, looking for substring 200
  • If s contains "200", test each one-bit modification of s to see if it is simple
  • , . , 200-, .

, , - , . -, ( )? , , , 200. - ?

!

+3

All Articles