# Questions tagged [integer-partitions]

For challenges related to the different ways of expressing an integer as a sum of positive integers.

58 questions
Filter by
Sorted by
Tagged with
205 views

### Binary expansion and partition numbers [closed]

Not sure if it's correct to ask such a question on this site, but let's try. Let a(n) be a sequence of positive integer such that a(1) = 1. To reproduce the sequence a(n) through itself, use the ...
2k views

### Write a number as a sum of Fibonacci numbers

In 2009, Hannah Alpert described the "far-difference" representation, a novel way of representing integers as sums and differences of Fibonacci numbers according to the following rules: ...
368 views

### Best partitioning set

Given an array of $n$ positive integers we will say its self-sum order is the number of ways to add elements from it to make $n$. We will count ways as distinct up to associativity. So $1+(2+3)$...
593 views

### Count the number of compositions of $n$ in which the greatest part is odd

A composition of an integer $n$ is a representation of $n$ as a sum of positive integers. For example the eight compositions of 4 are as follows: ... 1k views

### Number of ways to make an amount with coins

This is not a duplicate of Sum of combinations with repetition. This question considers 1+2 to be the same as 2+1. The other ...
835 views

### Sum of partition numbers

The partition function: In number theory, the partition function p(n) represents the number of possible partitions of a positive integer n into positive integers For instance, p(4) = 5 because the ...
395 views

### Help me design an unfair laundry machine

There's a payment machine for laundry in my building which does a few frustrating things. The ones relevant to this challenge are: It doesn't make change. So if you pay over the amount then you are ...
2k views

### There's more than one way to skin a set

Given a set of positive integers $S$, output the set of all positive integers $n$ such that $n$ can be made by summing a subset of $S$ in more than one different way, i.e., that are ...
414 views

### Split given integer into a given number of integers, each within given bounds

Input variables: (Names are just examples, they don't need to be named like this) GrandTotal - integer to divide SplitCount - ...
515 views

### Mirror an integer... in NDos' way

NDos' Numeral System NDos' numeral system is a numeral system invented by me. It represents every nonnegative integer by a binary tree. Given a nonnegative integer $n$: If $n=0$, it is ...
2k views

### 1 bit, 2 bits, 3 bits, …

Given a positive integer $n$, your task is to find out the number of partitions $a_1+a_2+\dots+a_k=n$ where each $a_j$ has exactly $j$ bits set. For instance, there are $6$ such partitions ...
796 views

### AoCG2021 Day 14: Adjusting dancing program's period

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2017 Day 16. I'm using the wording from my Puzzling SE puzzle based on the same AoC challenge instead of the ...
1k views

### Minimally prepend numbers to get a symmetric Young diagram

Background A Young diagram is a diagram that represents a nonincreasing sequence of positive integers using left-justified rows of squares. As an example, 5, 4, 1 ...
939 views

### Non-sums of distinct positive powers

There are 31 positive integers that cannot be expressed as the sum of 1 or more distinct positive squares: ...
3k views

### Display a number in Toki Pona

Toki Pona is a constructed language with 137ish words, designed to constrain the speaker to expressing ideas in a simple and straightforward manner, reducing ideas to more essential forms. Often, ...
1k views

### List array elements which can be summed from other elements

Consider an array of unique integers, with an arbitrary length greater than 2. It is sometimes possible to express elements of the array as the sum of at least two other elements. For example, if our ...
3k views

### Number of coins needed to make change

Relatable scenario: I'm going to the store to buy a single item, but only have a $100k bill. As a result, I need exactly$99,979 in change, and in the fewest coins/bills possible because I'm quite ...
1k views

### Minimally Making Change

This problem is an extension of what happens to me on a regular basis: I have to have \$1.00 in coins and have to be able to give change to somebody. I discovered rather quickly that the ideal coins to ...
1k views

### I ain't no Fortunate sum

The primorial $p_n\#$ is the product of the first $n$ primes. The sequence begins $2, 6, 30, 210, 2310$. A Fortunate number, $F_n$, is the smallest integer $m > 1$ such that $p_n\# + m$ ...
503 views

### Constrained integer partition

Challenge In this challenge, all numbers are in $\mathbb{N}_0$. Create a function or program that, when given a number $N$ and a tuple of $k$ numbers $(n_i)$ (all ≤ $N$), returns the number ...
3k views

8k views

### Chicken McNugget Numbers

Description Chicken McNugget numbers are numbers that can be expressed as a sum of $6$, $9$ or $20$ - the initial sizes of the famous Chicken McNuggets boxes sold by McDonald's. In that sum, a ...
2k views

### Fewest operations to 100

Overview Given a list of digits, find the fewest operations to make 100 Input A string of digits, which may or may not be in numerical order. The order of the digits cannot be changed, however plus ...
7k views

### 11 = (1+2+3+4+5) - (1+2+3) + (6) - (4)

Given a positive integer N, your task is to return the number of steps required by the following algorithm to reach N: Find the smallest triangular number Ti such that Ti ≥ N. Build the ...
75 views

### Code Golf - Print all unique ways of writing a number as a sum with a lexical order [duplicate]

I found about Code Golf after writing this program and decided to post the rules here so you can try it out too. I saw this, which is a less restrictive version of my question. I've got a bit more ...
6k views

### A penny saved is a penny

...counted! You will pass your program a variable which represents a quantity of money in dollars and/or cents and an array of coin values. Your challenge is to output the number of possible ...
3k views

### List all ordered partitions of n

The challenge is to list all ordered partitions (composition (combinatorics)) of a given positive integer n. These are the lists of numbers from ...
2k views

### Calculate the partitions of N

Your challenge is simple: GIven an integer N, ouput every list of positive integers that sums to N. For example, if the input was 5, you should output ...
2k views

### Strict partitions of a positive integer

OEIS A000009 counts the number of strict partitions of the integers. A strict partition of a nonnegative integer n is a set of positive integers (so no repetition ...
3k views

### This Challenge Makes Cents

I know, the title cracks you up Given an amount of money, output the fewest number of coins that make up that amount. Examples ...
437 views

### Partitioning reciprocals

Given a number n > 77, write a program or function that finds a set of distinct positive integers such that the sum of the set equals n, and the sum of the reciprocals of the set equals 1. Example ...
4k views

### Sums of Consecutive Integers

Before anyone says anything, similar and similar. But this is not a dupe. Some positive integers can be written as the sum of at least two consecutive positive integers. For example, ...
2k views

### Minimum number of numbers to sum to exactly n

First question here, don't yell at me if this is a duplicate or a bad challenge. Introduction I thought of this challenge myself, and it seems to be a good basic puzzle for beginner code-golfers. It ...
652 views

### Find the sets of sums

I've enjoyed reading this site; this is my first question. Edits are welcome. Given positive integers $n$ and $m$, compute all ordered partitions of $m$ into exactly $n$ positive integer parts,...