Page 1 of 1

Problem 077

Posted: Fri Sep 19, 2008 12:52 pm
by tryitn1
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.

Re: Problem 077

Posted: Wed Jul 07, 2010 11:59 am
by elr
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]

Re: Problem 077

Posted: Wed Jul 07, 2010 12:09 pm
by Lord_Farin
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)

Re: Problem 077

Posted: Wed Jul 07, 2010 12:18 pm
by elr
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

Re: Problem 077

Posted: Wed Jul 07, 2010 12:42 pm
by harryh
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

What's your 8th way ?

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).

Re: Problem 077

Posted: Wed Jul 07, 2010 3:01 pm
by elr
thanks !

i have solved it :)

i think more examples shuld be added to the problem description

Re: Problem 077

Posted: Tue May 20, 2014 4:41 pm
by pimspelier
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.

Re: Problem 077

Posted: Wed May 20, 2020 10:47 pm
by Junglemath
Are we only considering sums that have at least two summands, as in problem 76? Please update the problem statement if yes. Thanks.

Re: Problem 077

Posted: Thu May 21, 2020 1:49 am
by dawghaus4
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