Problem 333

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.
Post Reply
elr
Posts: 67
Joined: Thu Apr 09, 2009 9:47 am

Problem 333

Post by elr »

i think that i miss something

the problem statement saying that :
"The sum of the primes q <100 such that P(q)=1 equals 233."
however my calculations saying that the sum is 630 :
Expand
5:3+2
7:4+3
13:9+4
17:9+8
31:27+4
41:32+9
43:27+16
47:27+12+8
59:32+27
61:27+18+16
71:36+27+8
73:64+9
79:36+27+16
83:81+2
i am wondering how a sum of 233 could be made ?
Image
User avatar
jaap
Posts: 588
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 333

Post by jaap »

You have some false positives, for example:
31 = 27 + 4 = 9 + 6 + 16
41 = 9 + 32 = 27 + 6 + 8
and some missing ones, for example:
23 = 9 + 6 + 8

It looks like you are only using powers of 2 and powers of 3, and missing out terms like 6 which are neither.
gsidebottom
Posts: 1
Joined: Tue May 03, 2011 4:40 am

Re: Problem 333

Post by gsidebottom »

I'm having problems with this one as well. In particular, my program is getting the sum of the primes q <100 such that P(q)=1 equals 490. Below are the primes less than 100 with unique partitions as far as I understand. Anybody see what my problem is?
Expand
2=2
3=3
5=3+2
7=4+3
13=9+4
17=9+8
23=9+8+6
43=27+16
59=32+27
61=27+18+16
71=32+27+12
89=81+8
97=81+16
User avatar
jaap
Posts: 588
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 333

Post by jaap »

gsidebottom wrote:71=32+27+12
89=81+8
97=81+16
71 = 27 + 36 + 8
89 = 27 + 18 + 12 + 32
97 = 27 + 6 + 64
User avatar
PhilLeTaxi
Posts: 20
Joined: Wed Mar 05, 2014 12:54 pm
Location: Paris, France

Re: Problem 333

Post by PhilLeTaxi »

Hi,
for q < 10000, is 1404597 correct ?
Image
vamsikal3
Posts: 89
Joined: Sat Oct 01, 2016 9:25 am

Re: Problem 333

Post by vamsikal3 »

<deleted post>
Last edited by vamsikal3 on Fri Nov 27, 2020 3:11 am, edited 2 times in total.
my friend key --> 990813_OZPwQtCjkD6KlvxirOoTSZxccMFsuw1L
Image
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 333

Post by hk »

Confirmed.
Image
War ruins the life and health of untold numbers of innocent children.
vamsikal3
Posts: 89
Joined: Sat Oct 01, 2016 9:25 am

Re: Problem 333

Post by vamsikal3 »

<deleted post>
Last edited by vamsikal3 on Fri Nov 27, 2020 3:11 am, edited 2 times in total.
my friend key --> 990813_OZPwQtCjkD6KlvxirOoTSZxccMFsuw1L
Image
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 333

Post by Jochen_P »

Resuming the problems after a long break.

My terms for q <100 are
[2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96]

my result for P(q)=1 for q<100 is 228 (instead of 233) :shock:

Has anybody any clue where I'm going wrong?

My primes with P(q) = 1 are

5
7
13
17
23
43
59
61
Image
traxex
Posts: 66
Joined: Thu Oct 19, 2017 1:30 pm

Re: Problem 333

Post by traxex »

Jochen_P wrote: Wed Mar 28, 2018 7:24 pm my result for P(q)=1 for q<100 is 228 (instead of 233) :shock:
Perhaps you are missing two small primes that sum to 5? :D
Technically, everyone is full of himself.
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 333

Post by Jochen_P »

Aye, thanx a lot!

I kind of left them out by purpose.. thought once again incorrectly that a partition must consist of n>1 elements. m(
Now to make this bugger efficient. Runs way too long to get P(q)=1 for q<10**6
Image
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 333

Post by Jochen_P »

... way too long to get even sum P(q)=1 for q<10**3.
4600 in a bit more than an hour m(

Can't think of any other good way to optimize that anymore, there are way too many partitions to check.
There has to be a simple rule/formula for excluding terms in this, but damn, do I suck at maths :mrgreen:
Image
Col_Kernel
Posts: 1
Joined: Sun Oct 15, 2017 11:17 am

Re: Problem 333

Post by Col_Kernel »

Is it possible that "Confimed." above refers to something in the deleted post? First I believed it refers to the preceding question for q < 10000 and started to debug my algorithm. But I get 24853 for q < 10000 (and my answer for 10^6 got accepted :D ).
Post Reply