Problem 200

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
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.

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


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
User avatar
JamieCamardelle
Posts: 20
Joined: Wed May 14, 2008 5:34 am

clarifying problem 200

Post by JamieCamardelle »

Hi, thanks for keeping up such a great website. I just need to know, for problem 200, is it a valid change to turn the first digit into a zero? Just want to know because the change is drastic, creating a new number of one fewer digits than the other. Thanks.

User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: clarifying problem 200

Post by Tommy137 »

Yes, I think so. It's some time ago I solved this problem, but looking at my algorithm, I did turn the first digit into a zero, too.
Last edited by Tommy137 on Wed Oct 29, 2008 10:36 pm, edited 1 time in total.
Image

User avatar
jaap
Posts: 551
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: clarifying problem 200

Post by jaap »

Leading zeroes are never allowed in any of the problems, including this one.
It might not make much difference here since most prime-proof numbers are even....

quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: clarifying problem 200

Post by quilan »

I think he means checking if a number is prime-proof. In which case, according to my algorithm (and most of the others in the discussion), you can swap out a zero for the first digit. If this isn't intended behavior, then I guess it doesn't make a difference.
ex ~100%'er... until the gf came along.
Image

User avatar
jaap
Posts: 551
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: clarifying problem 200

Post by jaap »

quilan wrote:I think he means checking if a number is prime-proof. In which case, according to my algorithm (and most of the others in the discussion), you can swap out a zero for the first digit.
A string of digits that starts with a zero is strictly speaking not a number so checking whether it is prime or not does not make sense.
My program never changed the first digit to zero. I think it happens to be the case that it doesn't matter in this problem.

User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: clarifying problem 200

Post by Tommy137 »

jaap wrote:Leading zeroes are never allowed in any of the problems
You're right, of course.

I wonder why it didn't come to my mind, when I coded my program. Obviously I just started to write it, then run it and checked the solution :D
Image

User avatar
JamieCamardelle
Posts: 20
Joined: Wed May 14, 2008 5:34 am

Re: clarifying problem 200

Post by JamieCamardelle »

Thanks for the answers. It seems I can go about it either way.

User avatar
uws8505
Posts: 58
Joined: Tue Sep 30, 2008 3:13 pm
Location: South Korea

Problem 200

Post by uws8505 »

Is there any odd prime-proof sqube which contains the contiguous sub-string "200"?
Math and Programming are complements

User avatar
DNS
Posts: 30
Joined: Thu Oct 16, 2008 9:32 am
Location: Ukraine, Nikolaev

Re: Problem 200

Post by DNS »

Yes, there is
2 x 2 = 4 = true

ImRe
Posts: 12
Joined: Thu Aug 28, 2008 3:09 pm

Re: Problem 200

Post by ImRe »

Could somebody explain me what is this "changing a single digit to make it prime" thing?

Thx.

quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: Problem 200

Post by quilan »

For example 72, the following are prime numbers:
71, 73, 79

For 200 none of the following are prime numbers:
100,200,300,...,900
200,210,220,...,290
200,201,202,...,209

Thus, 72 can change one digit to make it a prime, but 200 can never change only one digit to make it a prime and thus is prime-proof.
ex ~100%'er... until the gf came along.
Image

User avatar
BostonBear
Posts: 17
Joined: Thu Apr 28, 2011 4:48 am
Location: Saugus, MA

Re: Problem 200

Post by BostonBear »

I am confused about the precise definition of "sub-string" in this problem. does that mean the sqube can NOT either Start or End with "200"?

User avatar
jaap
Posts: 551
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 200

Post by jaap »

BostonBear wrote:I am confused about the precise definition of "sub-string" in this problem. does that mean the sqube can NOT either Start or End with "200"?
The "200" can be at the start, middle, or end (or can even occur multiple times). Sub-string simply means that the three digits "2", "0", and "0" must be adjacent and in that order.

olopierpa
Posts: 9
Joined: Fri May 06, 2011 9:12 am

Re: Problem 200

Post by olopierpa »

I must be doing something silly with this one (Problem 200 (View Problem))

Can someone kindly check if the first few numbers satisfying the conditions are the following?

(1 200)
(2 1992008)
(3 20047112)
(4 42120027)

Thanks!
Last edited by olopierpa on Fri May 25, 2012 3:56 pm, edited 1 time in total.
Image

thundre
Posts: 356
Joined: Sun Mar 27, 2011 10:01 am

Re: Problem 200

Post by thundre »

olopierpa wrote:I must be doing something silly with this one (Problem 200 (View Problem))

Can someone kindly check if the first few numbers satisfying the conditions are the following?
That's a lot of results to post in a forum with a dancing header that says "In particular don't post any code fragments or results".

Your 4th number is not prime-proof. Add 400 and you get a prime.
Image

olopierpa
Posts: 9
Joined: Fri May 06, 2011 9:12 am

Re: Problem 200

Post by olopierpa »

Thanks for the help! (I have reduced the info posted, PM me if it's still not appropriate)
Image

olopierpa
Posts: 9
Joined: Fri May 06, 2011 9:12 am

Re: Problem 200

Post by olopierpa »

Done! :D

It was a silly one character mistake.

Now on to the problem thread, to see all the wonderful optimization opportunities I missed. :lol:
Image

User avatar
PhilLeTaxi
Posts: 20
Joined: Wed Mar 05, 2014 12:54 pm
Location: Paris, France

Re: Problem 200

Post by PhilLeTaxi »

Hi,

Can someone tell me if the following squbes are correct ?

5th : 71952008
50th : 20074469192
100th : 102005604488
Image

User avatar
PhilLeTaxi
Posts: 20
Joined: Wed Mar 05, 2014 12:54 pm
Location: Paris, France

Re: Problem 200

Post by PhilLeTaxi »

OK, I solved the problem. :D
The 50th and the 100th mentionned above were not correct.
The 50th is : 20016803528
The 100th is : 72007089032
In fact, I was stopping the search too earlier and missed some smaller squbes.
Image

h_anand
Posts: 13
Joined: Wed May 27, 2015 1:45 am

Re: Problem 200

Post by h_anand »

How many primes should I generate?

I generated more than 203 million primes (sieved from ~4.29 billion numbers) but I could find only 26 prime-proof squbes containing 200.

The last of these 26 are:

<values removed by moderator>

Could someone please confirm whether my results are correct?
Last edited by RobertStanforth on Tue May 01, 2018 8:38 am, edited 1 time in total.
Reason: Redacted partial results

Post Reply