mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2015-11-28, 10:56   #1
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

160658 Posts
Default A small puzzle

Here's a no doubt not-terribly-difficult problem, but it's not exactly trivial. I have little interest in actually solving it, so here it is for the forum's
enjoyment:

Given a target n and a count c, how many different ways are there for `c` integers to sum to `n`?

For instance, with n=11 and c=4, the total is eleven:
Code:
(1, 1, 1, 8)
(1, 1, 2, 7)
(1, 1, 3, 6)
(1, 1, 4, 5)
(1, 2, 2, 6)
(1, 2, 3, 5)
(1, 2, 4, 4)
(1, 3, 3, 4)
(2, 2, 2, 5)
(2, 2, 3, 4)
(2, 3, 3, 3)

Last fiddled with by Dubslow on 2015-11-28 at 10:57
Dubslow is offline   Reply With Quote
Old 2015-11-28, 11:15   #2
axn
 
axn's Avatar
 
Jun 2003

22×3×421 Posts
Default

https://en.wikipedia.org/wiki/Partit...umber_of_parts
axn is online now   Reply With Quote
Old 2015-11-28, 11:54   #3
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts
Default

Ah. Well I wasn't wrong (rather, my google queries into the matter were ignorant of the extant terminology)

Last fiddled with by Dubslow on 2015-11-28 at 11:54
Dubslow is offline   Reply With Quote
Old 2015-11-28, 15:00   #4
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

22·1,549 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Given a target n and a count c, how many different ways are there for `c` integers to sum to `n`?

For instance, with n=11 and c=4, the total is eleven:
Code:
(1, 1, 1, 8)
(1, 1, 2, 7)
(1, 1, 3, 6)
(1, 1, 4, 5)
(1, 2, 2, 6)
(1, 2, 3, 5)
(1, 2, 4, 4)
(1, 3, 3, 4)
(2, 2, 2, 5)
(2, 2, 3, 4)
(2, 3, 3, 3)
The puzzle as stated has an infinite number of solutions.

So your puzzle in return it is discover why it has in infinite number of solutions.
retina is offline   Reply With Quote
Old 2015-11-28, 15:31   #5
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts
Default

Quote:
Originally Posted by retina View Post
The puzzle as stated has an infinite number of solutions.

So your puzzle in return it is discover why it has in infinite number of solutions.
Do you perhaps refer to my lack of specifying strictly positive integers?
Dubslow is offline   Reply With Quote
Old 2015-11-28, 15:42   #6
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

2·3·7·233 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Do you perhaps refer to my lack of specifying strictly positive integers?
Your original post did not specify that. BTW there is a term specifically for them "natural numbers".
Uncwilly is online now   Reply With Quote
Old 2015-11-28, 16:13   #7
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

100101100010112 Posts
Default

[deleted]
sorry, ignore this, I didn't read to the end

Last fiddled with by LaurV on 2015-11-28 at 16:14
LaurV is offline   Reply With Quote
Old 2015-11-28, 16:27   #8
davar55
 
davar55's Avatar
 
May 2004
New York City

2×29×73 Posts
Default

Quote:
Originally Posted by LaurV View Post
[deleted]
sorry, ignore this, I didn't read to the end
oops, me too, started to jump in too soon.
typical.

davar55 is offline   Reply With Quote
Old 2015-11-28, 16:31   #9
davar55
 
davar55's Avatar
 
May 2004
New York City

2×29×73 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
Your original post did not specify that. BTW there is a term specifically for them "natural numbers".
The naturals are 1,2,3,..., and don't usually include 0.
The axiomatic approach begins with 0 and a successor rule.
By starting with 0, instead of 1, it's easier to define the
arithmetic operations.
davar55 is offline   Reply With Quote
Old 2015-11-28, 17:05   #10
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

2·3·7·233 Posts
Default

Quote:
Originally Posted by davar55 View Post
The naturals are 1,2,3,..., and don't usually include 0.
The way that I was taught "natural numbers" and "whole numbers" were differentiated by 0 being in one and not the other. Trying to reconfirm before posting led to some confusion. The way I recall:
[[[[[whole]natural]integers]rational]+[irrational]]=[real]
[imaginary]
Uncwilly is online now   Reply With Quote
Old 2015-11-28, 17:16   #11
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Quote:
Originally Posted by Dubslow View Post
but it's not exactly trivial.

Code:
partitions(n,,[c,c])
in PARI would work
science_man_88 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Small but nontrivial prime puzzle mart_r Puzzles 85 2018-02-11 18:55
SQL puzzle Prime95 Programming 1 2017-05-13 16:01
Sieving with powers of small primes in the Small Prime variation of the Quadratic Sieve mickfrancis Factoring 2 2016-05-06 08:13
now HERE'S a puzzle. Orgasmic Troll Puzzles 6 2005-12-08 07:19
Small set of 12 GP2 Completed Missions 2 2003-10-03 18:30

All times are UTC. The time now is 03:32.


Sat Jul 17 03:32:59 UTC 2021 up 50 days, 1:20, 1 user, load averages: 2.62, 2.18, 1.74

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.