Problem 111

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
nandor
Posts: 438
Joined: Mon Jan 08, 2007 9:31 pm
Location: Columbus, OH, USA
Contact:

Problem 111

Post by nandor »

Greetings. I THOUGHT that problem 111 would be rather easy. Unfortunately, I'm coming up with the incorrect answer (530414267192) and have NO idea what the issue must be.

This is the problem in which we try to find the primes with the maximum number of repeated digits for each digit. For instance, for four digits, there exists at least one prime such that there are three 1's in it. In fact, there are nine of them. So the M(4,1) = 3 since there is a maximum of three 1's (1111 is not prime), and N(4,1) = 9 since there are nine such primes. The problem, essentially, is to find all M(10,d) and N(10,d) (yes, the problem is actually to sum them, but if you can find them, then summing them should be relatively easy, and I don't want to give too much away if others are having problems with it). Can someone verify the following table?

Thanks!



Nandor

ps. If the below table IS too much information to post here, please let me know.


[tt]d M(10,d) N(10,d)
-------------------------------
0 8 8
1 9 11
2 8 34
3 9 7
4 9 1
5 9 1
6 9 1
7 9 9
8 8 24
9 9 8[/tt]
harryh
Posts: 2091
Joined: Tue Aug 22, 2006 9:33 pm
Location: Thessaloniki, Greece

Post by harryh »

Your values for M(10,d) seem correct. Your values for N(10,d) are mostly correct. I get higher values for d=2 and d=8. Are you sure you are checking all combinations for the remaining two digits? (I think you exclude some non-leading zero's, but why should you do that ?)
User avatar
nandor
Posts: 438
Joined: Mon Jan 08, 2007 9:31 pm
Location: Columbus, OH, USA
Contact:

Thanks.

Post by nandor »

Thanks, harryh, that's precisely what the issue was. Don't quite know how I missed that one!
User avatar
jake223
Posts: 61
Joined: Mon Apr 25, 2011 5:15 am
Location: USA
Contact:

Re: Problem 111

Post by jake223 »

I get the same values for M(10,d) and N(10,d) as Nandor except the following. anybody know where I might be going wrong? are these too high or too low?
Expand
N(10,2)=81
N(10,8)=64
Thanks for any help.
Image
thundre
Posts: 356
Joined: Sun Mar 27, 2011 10:01 am

Re: Problem 111

Post by thundre »

jake223 wrote:I get the same values for M(10,d) and N(10,d) as Nandor except the following. anybody know where I might be going wrong? are these too high or too low?
Too high. You're either counting some numbers multiple times or counting some which are not prime or fail the other criteria.
Image
User avatar
jake223
Posts: 61
Joined: Mon Apr 25, 2011 5:15 am
Location: USA
Contact:

Re: Problem 111

Post by jake223 »

Thanks. I figured out I was counting most of them twice and allowing leading zeroes on 2s, not 8s. Solved it now :D
Image
steinke
Posts: 2
Joined: Thu Feb 20, 2014 7:31 pm

Problem 111

Post by steinke »

Obviously I cannot find the right answer for problem 111.
I am a little desperate, can anyone give me some hint, what is wrong with my results?
My results are:
Sum primes found digit max number

38.000.000.042 8 0 8
12.882.626.601 11 1 9
118.046.935.626 48 2 8
23.234.122.821 7 3 9
4.444.444.447 1 4 9
5.555.555.557 1 5 9
6.666.666.661 1 6 9
59.950.904.793 9 7 9
374.455.893.316 42 8 8
78.455.389.922 8 9 9

721692539786 136
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 111

Post by hk »

@Steinke, we realise that you are new here, but please don't start a new topic for a problem if there exists already one.
Image
War ruins the life and health of untold numbers of innocent children.
thundre
Posts: 356
Joined: Sun Mar 27, 2011 10:01 am

Re: Problem 111

Post by thundre »

steinke wrote: Sum primes found digit max number

118.046.935.626 48 2 8
374.455.893.316 42 8 8
Those "primes found" counts are wrong.
Image
steinke
Posts: 2
Joined: Thu Feb 20, 2014 7:31 pm

Re: Problem 111

Post by steinke »

thanks thundre
I eliminated some double primes for 2's and 8's.
now the result is OK
larryleinweber
Posts: 4
Joined: Sat Sep 20, 2014 4:51 pm

Problem 111 English

Post by larryleinweber »

Problem 111 is titled "Primes with runs." The problem text discusses repeated digits but not uninterrupted sequences of a digit. The term "run" in the title implies uninterrupted sequences and is misleading.
deejinator
Posts: 11
Joined: Tue Feb 25, 2014 5:41 pm

Re: Problem 111

Post by deejinator »

For 2s I get ## primes, and for 8s I get ## primes. How far off am I?
Last edited by deejinator on Mon Mar 23, 2015 2:24 pm, edited 1 time in total.
User avatar
Georg
Posts: 157
Joined: Mon Jan 21, 2008 7:00 am
Location: Mannheim, Germany
Contact:

Re: Problem 111

Post by Georg »

Seven.
deejinator
Posts: 11
Joined: Tue Feb 25, 2014 5:41 pm

Re: Problem 111

Post by deejinator »

Thanks. Anybody else having trouble with this, check your list of primes and make sure there are no duplicates.
User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 111

Post by Oliver1978 »

In my program S(4,d) comes out correctly. That's something, but surely doesn't prove a thing. Could anybody confirm that S(3,d) = *283 and S(7,d) = 1961*? [* as usual, an undefined number of digits]
49.157.5694.1125
User avatar
Georg
Posts: 157
Joined: Mon Jan 21, 2008 7:00 am
Location: Mannheim, Germany
Contact:

Re: Problem 111

Post by Georg »

Yes and no.
User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 111

Post by Oliver1978 »

OP wrote:
nandor wrote:[...]
d       M(10,d)       N(10,d)
-------------------------------
0       8                8
1       9                11
2       8                34
3       9                7
4       9                1
5       9                1
6       9                1
7       9                9
8       8                24
9       9                8
Should this table be correct? I'm being quite dazzled. M(10, 0) = 8 seems trivial, but the only n for which I get M(n, d) = 9 are 4, 5, 6, 7. I've already checked factorizations of 10-digit numbers with 9 consecutive 1s for primality - and found none.

:?:
49.157.5694.1125
User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 111

Post by Oliver1978 »

Can anyone confirm my suspicions?
49.157.5694.1125
MHealy
Posts: 40
Joined: Sat Nov 17, 2012 11:32 pm

Re: Problem 111

Post by MHealy »

Oliver1978 wrote:Should this table be correct? I'm being quite dazzled. M(10, 0) = 8 seems trivial, but the only n for which I get M(n, d) = 9 are 4, 5, 6, 7. I've already checked factorizations of 10-digit numbers with 9 consecutive 1s for primality - and found none.

:?:
I haven't checked the table, but I think I know what your issue is. The problem talks of repeated digits, whereas you mention checking for consecutive 1s.

Looking at the example in the problem, we see that 1117 has three repeated ones which are consecutive, whereas 1151 has three repeated ones which aren't consecutive, but is still valid.

I can assure you that there is at least one 10-digit prime containing nine (not necessarily consecutive) 1s.
Image
User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 111

Post by Oliver1978 »

Hmm... Shouldn't that be the matter with N? Just like in the description M(4,1) = 3, but N(4,1) = 9. A 4-digit prime has at most 3 consecutive 1s, and 9 primes having 4 digits contain 3 repeated 1s. So I figured M() is about the maximum number of consecutive digits d.
49.157.5694.1125
Post Reply