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.
MHealy
Posts: 40
Joined: Sat Nov 17, 2012 11:32 pm

Re: Problem 111

Post by MHealy »

Oliver1978 wrote: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.
No, whether the digits are consecutive is completely irrelevant. If the only primes in the example were 1151, 1171, 1181, 1511 and 1811, M(4,1) would still be 3.
Image
User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 111

Post by Oliver1978 »

Ok. Which also bothers me is -from the table- N(10,0)=8. Since M(10,0)=9 there should be 8 primes with 10 digits containing 9 zeros. Is that right? The only 10-digit primes with 8 zeros I could find are 1000000007 and ...9.
49.157.5694.1125
MHealy
Posts: 40
Joined: Sat Nov 17, 2012 11:32 pm

Re: Problem 111

Post by MHealy »

Oliver1978 wrote:Ok. Which also bothers me is -from the table- N(10,0)=8. Since M(10,0)=8 there should be 8 primes with 10 digits containing 8 zeros. Is that right? The only 10-digit primes with 8 zeros I could find are 1000000007 and ...9.
Yes, there are eight of them. I assume the other values for N(10,d) which harryh did not say were wrong are also correct.
Image
User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 111

Post by Oliver1978 »

Thanks a lot for clearing this! I guess I wasn't the only one who took "consecutiv" for "repeated".
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 »

Finally owned this one. For those who are still seeking, OPs table proved a valuable asset for debugging. N(10, 2) and N(10, 8) are indeed incorrect. But once you have the others you will easily find N() for d = 2 and 8.
49.157.5694.1125
User avatar
RishadanPort
Posts: 79
Joined: Mon Jun 10, 2013 7:31 am

Re: Problem 111

Post by RishadanPort »

I might be missing something...

But why doesn't the question just ask: "What is the sum of all 10 digit primes"... end of question.
Image

Rishada is the gateway to free trade—but the key will cost you.
DJohn
Posts: 90
Joined: Sat Oct 11, 2008 12:24 pm

Re: Problem 111

Post by DJohn »

RishadanPort wrote: Mon Jul 29, 2019 3:38 am I might be missing something...

But why doesn't the question just ask: "What is the sum of all 10 digit primes"... end of question.
Simply because the solution is not the sum of all 10 digit primes.

For 4 digit numbers, 1013 is prime, but we don't include it in S(4, 1) because it only has 2 1s and M(4, 1) is 3. It won't be included in S(4, 0) or S(4, 3), because it doesn't have enough of those digits either.
User avatar
RishadanPort
Posts: 79
Joined: Mon Jun 10, 2013 7:31 am

Re: Problem 111

Post by RishadanPort »

Ah!

Oops

Also

I am assuming the same prime can be in 2 or more categories, and have it's sum added in multiple times?
Image

Rishada is the gateway to free trade—but the key will cost you.
DJohn
Posts: 90
Joined: Sat Oct 11, 2008 12:24 pm

Re: Problem 111

Post by DJohn »

RishadanPort wrote: Tue Jul 30, 2019 5:08 am I am assuming the same prime can be in 2 or more categories, and have it's sum added in multiple times?
It doesn't happen in the case of 4 digit primes, but there's nothing in the problem statement that rules it out. Each S() is evaluated independently.
oms1953
Posts: 4
Joined: Mon Jul 04, 2022 8:17 am

Re: Problem 111

Post by oms1953 »

I have the following as solution to Problem 111.

Code: Select all

| D | M | N  |       S      |
Snipped by moderator
Please don't post (partial) solutions
This is short of what the answer should be.
I think I generated all the prime 10-digit combinations.
I used Julia and used Julia's Combinatorics and Primes Package.
User avatar
SaxTenor
Posts: 18
Joined: Mon Sep 28, 2020 11:05 am
Location: Quebec City, QC, Canada

Re: Problem 111

Post by SaxTenor »

What exactly is your question?
Image
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 111

Post by hk »

@Saxtenor:
Question falls outside what we allow.
See the pink box.
Image
War ruins the life and health of untold numbers of innocent children.
oms1953
Posts: 4
Joined: Mon Jul 04, 2022 8:17 am

Re: Problem 111

Post by oms1953 »

SaxTenor wrote: Sat Jul 23, 2022 9:49 pm What exactly is your question?
I'm wrong and the question is how do I do it right? Any tip on how to do it right or where I can find resources to possible solutions will be appreciated.
User avatar
Oliver1012
Posts: 5
Joined: Sat Oct 05, 2024 5:10 pm

Re: Problem 111

Post by Oliver1012 »

Greetings, another evening, another pushed topic :-?

I have to go through all of the problems again due to a system failure with irrecoverable files holding the data. Anyways... dealing with #111 I've come across a problem. Would it be possible if someone verified my findings?

For 7-digit primes I get M(7, 2) = 5 with S(7, 2) = 117535528.
For 6-digit primes I get M(6, 7) = 5 with S(7, 7) = 8510217.
Furthermore, S(8, d) with 0 $\le$ d $\le$ 9 ends with 51254.

Could this be correct? Any help is appreciated. Thanks!
User avatar
SAG145
Posts: 41
Joined: Thu Apr 11, 2024 10:25 pm

Re: Problem 111

Post by SAG145 »

Your results for 6 and 7 digit primes are correct.
But for 8 digit primes the sum should end with 30042.
Also, I believe you have a typo - you wrote S(7,7) instead of S(6,7).
Image
User avatar
Oliver1012
Posts: 5
Joined: Sat Oct 05, 2024 5:10 pm

Re: Problem 111

Post by Oliver1012 »

SAG145 wrote: Thu Mar 06, 2025 9:17 am Your results for 6 and 7 digit primes are correct.
But for 8 digit primes the sum should end with 30042.
Also, I believe you have a typo - you wrote S(7,7) instead of S(6,7).
Thank you. And yes, you are correct, I meant to say S(6, 7).

I'm still not sure where my S(8, d) might go wrong :cry:
For example, I get M(8, 1) = 7 with a total sum of 288629940, and M(8, 9) = 7 with S(8, 9) = 1099396937.
User avatar
SAG145
Posts: 41
Joined: Thu Apr 11, 2024 10:25 pm

Re: Problem 111

Post by SAG145 »

S(8,1) = 266408728.
If you want you can PM me your code and I'll try to help you find the mistake.
Image
User avatar
Oliver1012
Posts: 5
Joined: Sat Oct 05, 2024 5:10 pm

Re: Problem 111

Post by Oliver1012 »

SAG145 wrote: Thu Mar 06, 2025 1:25 pm S(8,1) = 266408728.
If you want you can PM me your code and I'll try to help you find the mistake.
PM sent.... :wink:

...and solved 8-)
User avatar
blu.knite
Posts: 1
Joined: Tue Jul 01, 2025 10:38 pm

Re: Problem 111

Post by blu.knite »

I'm kinda stuck with this now. I've got it to the point where it will give me M, N and S for various d pretty quickly. The following two of my rows are different from OP's table (leaving out sums to avoid spoilers). Do these seem correct?

Code: Select all

M(10,2)=8, N(10,2)=40
M(10,8)=8, N(10,8)=34
Image
Post Reply