## Problem 077

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

Don't post any spoilers
tryitn1
Posts: 1
Joined: Fri Sep 19, 2008 12:46 pm

### Problem 077

i've solved problem 77 counting the number of ways using programming.

but i see the first post says about [snip], how is [snip] applicable here . What is it used for . Can someone explain or some examples why and where [snip] is used in general.

elr
Posts: 67
Joined: Thu Apr 09, 2009 9:47 am

### Re: Problem 077

for some reason my program does not work well (its work for the 10 case but gives a wrong answer for the > 5000 value)

can someone verify this values for me please :

{snip]

Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 10:43 am
Location: Netherlands

### Re: Problem 077

Nearly all your values are wrong. Small hint: Really just one way of writing 5? (how about 5=5?)
Also, please don't post so many values. If it's wrong, it will be clear too if you check two or three values. Better still, don't ask any... The idea of PE is that YOU solve it, and that includes debugging the program and algorithm you write (imho)

elr
Posts: 67
Joined: Thu Apr 09, 2009 9:47 am

### Re: Problem 077

the question state that any value is a sum of primes so the only way to write 5 as sum of primes is 3+2

i'm not a beginer in PE (already reached level 3 with over 120 problems solved)

the problem is that my program does work for the limit given in the problem

i'm not asking for the solution,just to know which values went wrong or if someone can supply me another valid example for another number
other than 10

harryh
Posts: 2091
Joined: Tue Aug 22, 2006 9:33 pm
Location: Thessaloniki, Greece

### Re: Problem 077

elr wrote:...
there are 8 ways to write 12
....
there are 13 ways to write 14
Problem 77 (View Problem)
I can only find 7 ways to write 12 as a sum of primes:
2+2+2+2+2+2
2+2+2+3+3
2+2+3+5
2+3+7
2+5+5
3+3+3+3
5+7

Similarly, I can only find 10 ways to write 14 as a sum of primes etc etc

-------------------------

5=5 is indeed generally considered as a valid way to write 5 as a sum of primes (in this case, the sum has only one term).
However, that is not important for this problem (it only affects the number of ways in which you can write a prime number as a sum of primes and it only changes that number by 1).

elr
Posts: 67
Joined: Thu Apr 09, 2009 9:47 am

### Re: Problem 077

thanks !

i have solved it

i think more examples shuld be added to the problem description

pimspelier
Posts: 41
Joined: Tue Jan 21, 2014 2:06 pm
Location: The Netherlands

### Re: Problem 077

I've already solved this problem, but my code is just brute force. So I scanned the forum, and the first link of BjornEdstrom looked interesting. Especially the link in the third line was nice, so I tried the third type in that link, also with $c_n$. Somewhere I've made a mistake, but I don't want to elaborate here. So I'll just reveal one of my values here: is $c_{94}$ 49?
Could anyone PM me about where I might have made a mistake? I'm willing to PM my code, but it looks (to me) like I just copied the formula's from the site.

EDIT: yeah, I solved it (again)! Somehow, ant+=... did something weird, while ant=ant+... worked fine ... or something.

Junglemath
Posts: 54
Joined: Fri Sep 20, 2019 1:25 pm
Location: Minsk

### Re: Problem 077

Are we only considering sums that have at least two summands, as in problem 76? Please update the problem statement if yes. Thanks.

dawghaus4
Posts: 55
Joined: Fri Nov 29, 2013 2:22 am

### Re: Problem 077

It won't matter which way you want to interpret "sum."

I'm old fashioned, a sum is always two or more numbers, unless otherwise specified.

Tom