[Question]
  [
The partition number of a positive integer is defined as the number of ways it can be expressed as a sum of positive integers. In other words, the number of integer partitions it has. For example, the number `4` has the following partitons:
```
[[1, 1, 1, 1], [1, 1, 2], [1, 3], [2, 2], [4]]
```
Hence, it has `5` partitions.
This is [OEIS A000041](https://oeis.org/A000041).
---
# Task
Given a positive integer **N** determine its partition number.
* All standard rules apply.
* The input and output may be handled through any reasonable mean.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins.
---
# Test Cases
```
Input | Output
1  |  1
2  |  2
3  |  3
4  |  5
5  |  7
6  |  11
7  |  15
8  |  22
9  |  30
10 |  42
```
  
[Answer]
## Mathematica, 11 bytes
```
PartitionsP
```
## Explanation
```
¬Ø\_(„ÉÑ)_/¬Ø
```
[Answer]
# [Pyth](https://pyth.readthedocs.io), 3 bytes
```
l./
```
**[Try it here!](https://pyth.herokuapp.com/?code=l.%2F&input=4&debug=0)** or **[Try a test Suite.](https://pyth.herokuapp.com/?code=l.%2F&input=4&test_suite=1&test_suite_input=1%0A2%0A3%0A4%0A5%0A6%0A7%0A8%0A9%0A10%0A11%0A12%0A13%0A14%0A15&debug=0)**
The answer took much longer to format than writing the code itself :P.
---
# How?
Pyth is the right tool for the job.
```
l./   Full program with implicit input.
 ./   Integer partitions. Return all sorted lists of positive integers that add to the input.
l     Length.
      Implicitly output the result.
```
[Answer]
# [Emojicode](http://www.emojicode.org/) 0.5, ~~204~~ 201 bytes
```
üêãüöÇüçáüêñüÖ∞Ô∏è‚û°üöÇüçáüçä‚¨Öüêï1üçáüçé1üçâüçÆs 0üîÇk‚è©0üêïüçáüç¶t‚ûñüêïküçÆr tüîÇi‚è©1 tüçáüçäüòõüöÆt i 0üçáüçÆ‚ûïr iüçâüçâüçÆ‚ûïs‚úñrüÖ∞Ô∏èküçâüçé‚ûósüêïüçâüçâ
```
[Try it online!](https://tio.run/##VU/NSsNAEL73KaZ3D8l79OArRLvQNSYLu1uKNy0USaWNYBuDShYhFASJ3uzz7Au4b9DObJaKh2Vnvvl@ZlgmrvilGLPDwZnHB2de5s6s7rGunFl8/@5L27z/oaul/VzgcBuHfk1Fga9TEDmzmae2/IiIEQg7bZuK@pRIEjSROJJiKntPZ@pXzOg0cDLxYGebrQQe3IuAKPtWybBYGvC1bZ5VSPRcvKS8I5sB0AJKo2Lzgw8Pqb/wb8@vWaIYsFwzCQnk0@yCEan1iiWpEKOzUQxx1JvhrL7tbfwCSMGZl1Du039WO2KJzGE2SfQpArg6gxsxhUxIkQ9PicXA7x1HRw "Emojicode ‚Äì Try It Online")
-3 bytes by using "less than or equal to 1" instead of "less than 2" because the "less than" emoji has a quite long UTF-8 encoding. Also made `t` a frozen to silence a warning without affecting the byte count.
Extends the üöÇ (integer) class with a method named üÖ∞Ô∏è. You can write a simple program that takes a number from the input, calls üÖ∞Ô∏è on the number and prints the result like this:
```
üèÅüçá
 üç¶strüî∑üî°üòØüî§Please enter a numberüî§
 üçäüç¶numüöÇstr 10üçá
  üòÄüî°üÖ∞Ô∏ènum 10
 üçâüçìüçá
  üòÄüî§Learn what a number is, you moron!üî§
 üçâ
üçâ
```
This part could be golfed a lot by omitting the messages and error handling, but it's not included in the score, so I prefer to show more features of Emojicode instead, while improving readability along the way.
### Ungolfed
```
üêãüöÇüçá
 üêñüÖ∞Ô∏è‚û°üöÇüçá
  üçä‚óÄÔ∏èüêï2üçá
   üçé1
  üçâ
  üçÆsum 0
  üîÇk‚è©0üêïüçá
   üç¶nmk‚ûñüêïk
   üçÆsig nmk
   üîÇi‚è©1 nmküçá
    üçäüòõüöÆnmk i 0üçá
     üçÆ‚ûïsig i
    üçâ
   üçâ
   üçÆ‚ûïsum‚úñsigüÖ∞Ô∏èk
  üçâ
  üçé‚ûósumüêï
 üçâ
üçâ
```
### Explanation
**Note:** a lot of emoji choice doesn't make much sense in emojicode 0.5. It's 0.x, after all. 0.6 will fix this.
Emojicode is an object-oriented programming language featuring generics, protocols, optionals and closures, but this program uses no closures and all generics and protocols can be considered implicit, while the only optional appears in the I/O stub.
The program operates on only a few types: üöÇ is the integer type, üî° is the string type and ‚è© is the range type. A few booleans (üëå) appear too, but they are only used in conditions. Booleans can take a value of üëç or üëé, which correspond to true and false, respectively.
There are currently no operators in Emojicode, so addition, comparsions and other operations that are normally operators are implemented as functions, effectively making the expressions use [prefix notation](https://en.wikipedia.org/wiki/Polish_notation). Operators are also planned in 0.6.
Let's tackle the test program first.
```
üèÅ
```
This is the üèÅ block, which can be compared to main from other languages.
```
üçá ... üçâ
```
Grapes and watermelons declare code blocks in emojicode.
```
üç¶strüî∑üî°üòØüî§Please enter a numberüî§
```
This declares a "frozen" named `str` and sets it value to a new string created using the initializer (constructor) üòØ, which takes a prompt as a string and then inputs a line from the user. Why use a frozen instead of a variable? It won't change, so a variable would emit a warning.
```
üçäüç¶numüöÇstr 10
```
Let's break it down. `üöÇstr 10` calls the üöÇ method on the `str` frozen with the argument 10. By convention, methods named with the name of a type convert the object to that type. 10 is the base to use for integer conversion. This method returns an optional, `üç¨üöÇ`. Optionals can contain a value of the base type or nothingness, ‚ö°. When the string doesn't contain a number, ‚ö° is returned. To use the value, one has to unwrap the optional using üç∫, which raises a runtime error if the value is ‚ö°. Therefore, it is good practice to check for nothingness before unwrapping an optional. It is so common, in fact, that Emojicode has a shorthand for that. Normally, `üçä` is an "if". `üçäüç¶ variable expression` means: evaluate the expression. If the optional contains nothingness, the condition evaluates to üëé (false). Otherwise, a frozen named `variable` is created with the unwrapped value of the optional, and the condition evaluates to üëç, (true). Therefore, in normal usage, the `üçá ... üçâ` block following the conditional is entered.
```
üòÄüî°üÖ∞Ô∏ènum 10
```
üÖ∞Ô∏è is the method the main code adds to üöÇ using üêã that calculates the number of partitions. This calls üÖ∞Ô∏è on the `num` frozen we declared in the conditional and converts the result to a string using base 10 by the üî° method. Then, üòÄ prints the result.
```
üçìüçá ... üçâ
```
üçì means "else", so this block is entered when the user did not enter a number correctly.
```
üòÄüî§Learn what a number is, you moron!üî§
```
Prints the string literal.
Now, let's look at the main program. I'll explain the ungolfed version; the golfed version just had the whitespace removed and variables renamed to single letter names.
```
üêãüöÇüçá ... üçâ
```
Extend the üöÇ class. This is a feature that is not commonly found in programming languages. Instead of creating a new class with üöÇ as the superclass, üêã modifies üöÇ directly.
```
üêñüÖ∞Ô∏è‚û°üöÇüçá ... üçâ
```
Creates a new method named üÖ∞Ô∏è that returns a üöÇ. It returns the number of partitions calculated using the formula `a(n) = (1/n) * Sum_{k=0..n-1} sigma(n-k)*a(k)`
```
üçä‚¨Öüêï1üçá
 üçé1
üçâ
```
üêï is similar to `this` or `self` from other languages and refers to the object the method was called on. This implementation is recursive, so this is the terminating condition: if the number the method was called on is less than or equal 1, return 1.
```
üçÆsum 0
```
Create a new variable `sum` and set it to 0. Implicitly assumes type üöÇ.
```
üîÇk‚è©0üêï
```
üîÇ iterates over anything that implements the üîÇüêö‚ö™Ô∏è protocol, while ‚è© is a range literal that happens to implement üîÇüêöüöÇ. A range has a start value, a stop value and a step value, which is assumed to be 1 if `start < stop`, or -1 otherwise. One can also specify the step value by using the ‚è≠ to create the range literal. The start value is inclusive, while the stop value is exclusive, so this is equivalent to `for k in range(n)` or the `Sum_{k=0..n-1}` in the formula.
```
üç¶nmk‚ûñüêïk
```
We need to calculate sigma(n - k), or the sum of divisors of `n - k` in other words, and the argument is needed a few times, so this stores `n - k` in the variable `nmk` to save some bytes.
```
üçÆsig nmk
üîÇi‚è©1 nmk
```
This sets the `sig` variable to the argument of sigma and iterates over all numbers from 1 to `nmk - 1`. I could initialize the variable to 0 and iterate over 1..nmk but doing it this way is shorter.
```
üçäüòõüöÆnmk i 0
```
üöÆ calculates the remainder, or modulus and üòõ checks for equality, so the condition will be üëç if `i` is a divider of `nmk`.
```
üçÆ‚ûïsig i
```
This is an assignment by call, similar to the `+= -= >>=` operator family in some of the inferior, emoji-free languages. This line can be also written as `üçÆ sig ‚ûï sig i`. Therefore, after the inner loop finishes, `sig` will contain the sum of divisors of `n - k`, or `sigma(n - k)`
```
üçÆ‚ûïsum‚úñsigüÖ∞Ô∏èk
```
Another assignment by call, so this adds `sigma(n - k) * A(k)` to the total, just as in the formula.
```
üçé‚ûósumüêï
```
Finally, the sum is divided by n and the quotient is returned. This explanation probably took thrice as much time as writing the code itself...
[Answer]
# [Python 2](https://docs.python.org/2/), 85 83 bytes
-2 bytes thanks to @notjagan
```
lambda n:n<1or sum(sum(i*((n-k)%i<1)for i in range(1,n+1))*p(k)for k in range(n))/n
```
[Try it online!](https://tio.run/##TYs7DsIwEAV7TrENym4IH1NG4SY0RvxWxi@WYwoUcnYT00Dxmpl54ZXuPfY5HI75Yf3pbAktOtNHGp6ey7RmxtrJUjsj11koKSha3C5sGqyMSB3YfZX7KYhskQvEf09mJ@2CKERFomqc6E3jVG3m0NvEaCiUa/4A "Python 2 ‚Äì Try It Online")
Using recursive formula from [OEIS A000041](https://oeis.org/A000041).
[Answer]
# [Python 2](https://docs.python.org/2/), ~~54~~ 53 bytes
```
f=lambda n,k=1:1+sum(f(n-j,j)for j in range(k,n/2+1))
```
[Try it online!](https://tio.run/##RYxBDoIwFAXXeoq3IbThE/O7JMG71EiRIg9SYOHpa125msVkZvscr5Uu59C//fJ4elDmXjtt9nMxwbCNEm1YEyImInmOg5mFN9eotfkn@BcqULXd9bKliQfqyp1o7yioUcFQUI4l@wI "Python 2 ‚Äì Try It Online")
### How it works
Each partition of **n** can be represented as a list **x = [x1, ‚ãØ, xm]** such that **x1 + ‚ãØ + xm = n**. This representation becomes unique if we require that **x1 ‚â§ ‚ãØ ‚â§ xm**.
We define an auxiliary function **f(n, k)** that counts the partitions with lower bound **k**, i. e., the lists **x** such that **x1 + ‚ãØ + xm = n** and **k ‚â§ x1 ‚â§ ‚ãØ ‚â§ xm**. For input **n**, the challenge thus asks for the output of **f(n, 1)**.
For positive integers **n** and **k** such that **k ≤ n**, there is at least one partition with lower bound **k**: the singleton list **[n]**. If **n = k** (in particular, if **n = 1**), this is the *only* eligible partition. On the other hand, if **k > n**, there are no solutions at all.
If **k < n**, we can recursively count the remaining partitions by building them from left to right, as follows. For each **j** such that **k ≤ j ≤ n/2**, we can build partitions **[x1, ‚ãØ, xm] = [j, y1, ‚ãØ, ym-1]**. We have that **x1 + ‚ãØ + xm = n** if and only if **y1 + ‚ãØ + ym-1 = n - j**. Furthermore, **x1 ‚â§ ‚ãØ ‚â§ xm** if and only if **j ≤ y1 ‚â§ ‚ãØ ‚â§ ym-1**.
Therefore, the partitions **x** of **n** that begin with **j** can be calculated as **f(n - j, j)**, which counts the valid partitions **y**. By requiring that **j ≤ n/2**, we assure that **j ≤ n - j**, so there is at least one **y**. We can thus count *all* partitions of **n** by summing **1** (for **[n]**) and **f(n - j, j)** for all valid values of **j**.
The code is a straightforward implementation of the mathematical function **f**. In addition, it makes **k** default to **1**, so `f(n)` computes the value of **f(n, 1)** for input **n**.
[Answer]
# [Pari/GP](http://pari.math.u-bordeaux.fr/), 8 bytes
```
numbpart
```
[Try it online!](https://tio.run/##K0gsytRNL/ifpmCr8D@vNDepILGo5H9afpFGHlDEUEfB0EBHoaAoM68EKKCkoGsHJNI08jQ1Nf8DAA "Pari/GP ‚Äì Try It Online")
[Answer]
## [Retina](https://github.com/m-ender/retina), 34 bytes
```
.+
$*
+%1`\B
;$'¬∂$`,
,
%O`1+
@`.+
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wX0@bS0WLS1vVMCHGictaRf3QNpUEHS4dLi5V/wRDbS6HBD3t//8NuYy4jLlMuEy5zLjMuSy4LLkMDQA "Retina ‚Äì Try It Online")
### Explanation
```
.+
$*
```
Convert the input to unary.
```
+%1`\B
;$'¬∂$`,
```
This computes all **2n-1** partitions of the unary digit list. We do this by repeatedly (`+`) matching the first (`1`) non-word boundary (`\B`, i.e. a position between two `1`s) in each line (`%`) and replacing it with `;`, everything after it (`$'`), a linefeed (`¬∂`), everything in front of it (`$``) and `,`. Example:
```
1;1,111
```
Becomes
```
      vv
1;1,1;11
1;1,1,11
^^^^^
```
Where `v` marks the result of `$'` and `^` marks the result `$``. This is a common idiom to get the result of two different replacements at once (we basically insert both the `;` and the `,` replacement, as well as the missing "halves" of the string to complete two full substitutions).
We will treat `;` as actual partitions and `,` just as placeholders that prevent subsequent `\B` from matching there. So next...
```
,
```
... we remove those commas. That gives us all the partitions. For example for input `4` we get:
```
1;1;1;1
1;1;11
1;11;1
1;111
11;1;1
11;11
111;1
1111
```
We don't care about the order though:
```
%O`1+
```
This sorts the runs of `1`s in each line so we get unordered partitions.
```
@`.+
```
Finally, we count the unique (`@`) matches of `.+`, i.e. how many distinct lines/partitions we've obtained. I added this `@` option ages ago, then completely forgot about it and only recently rediscovered it. In this case, it saves a byte over first deduplication the lines with `D``.
[Answer]
# [Python 2](https://docs.python.org/2/), 89 bytes
-9 bytes by Mr.Xcoder
-1 byte by notjagan
```
lambda n:len(p(n))
p=lambda n,I=1:{(n,)}|{y+(x,)for x in range(I,n/2+1)for y in p(n-x,x)}
```
[Try it online!](https://tio.run/##RcyxCsIwEIDhvU9xW@/oFW3GQNwLfQSXiFUP6jWEDgm1zx6tIK4fP3/Iy2NWUwZ3LpN/Xq4e1E6jYkAlqoL7Ifeusysq0/Zac4OJ6TZHSCAK0et9xJ71YJruy3nnz6JNnGgrO8m/NEeyFYQouoBw3Z5qHlCovAE "Python 2 ‚Äì Try It Online")
[Answer]
# Octave, 18 bytes
```
partcnt(input(''))
```
Uses the built-in function partcnt.
Can't get it right by using an anonymous function using @, some help would be appreciated.
[Answer]
# [J](http://jsoftware.com/), ~~37~~ 35 bytes
```
0{]1&((#.]*>:@#.~/.~&.q:@#\%#),])1:
```
[Try it online!](https://tio.run/##y/r/P03B1krBoDrWUE1DQ1kvVsvOykFZr05fr05NrxDIjFFV1tSJ1TS04uJKTc7IV9DQ0UtTMtBUsLNSyNRTMDT4/x8A)
## Explanation
```
0{]1&((#.]*>:@#.~/.~&.q:@#\%#),])1:  Input: n
                                 1:  Constant 1
  ]                                  Get n
   1&(                          )    Repeat n times on x = [1]
                          \            For each prefix
                         #               Length
                      q:@                Prime factors
                 /.~&                    Group equal factors
              #.~                        Compute p+p^2+...+p^k for each group
           >:@                           Increment
                    &.q:                 Product
                           %           Divide
                            #          Length
         ]                             Get x
          *                            Times
   1   #.                              Sum
                              ,        Joim
                               ]       Get x
                                       Set this as next value of x
0{                                   Select value at index 0
```
[Answer]
# Regex `üêá` ([RME](https://github.com/Davidebyzero/RegexMathEngine/) / Perl / PCRE2 v10.35+), ~~13~~ 12 bytes
```
((\1|^)x*)+$
```
[Try it on replit.com](https://replit.com/@Davidebyzero/regex-Unordered-partitions-PerlPCRE2) - RegexMathEngine  
[Try it online!](https://tio.run/##RU9BasMwELznFYtYgra2E7mQS2TFDqTXnnprUpGaBARq4souuCjqsQ/oE/sRV3ELvSw7s7M7s83B2cXw8g7oJHh7rvcWcC4jVMVm/bBehcnx7Di2SshiJcmDOUZEvnHm1AHbnpgMUFnVNtZ0nGUsbd@e2y6u6DTL05wOr1dR@c@KyNMSNcnrrTY67l1li1vylX3MdypWsZNhAjA6mz8CTaFGQeyShDzWMRJw1rMeDamPOS@X6IiXpU8SrFMR6PpHO52OUcek8Y1cwm90NDMG359fwGZYR@EljkLQ@u5@o/XA@Ta/PFF/QwkOg8gW4gc "Perl 5 ‚Äì Try It Online") - Perl v5.28.2 / [Attempt This Online!](https://ato.pxeger.com/run?1=RU-xTsMwEBVrN_7Ask6VTZLWQUJCddykUlmZ2GixStRIlkwb4lQKcs3IB7CydGg3voiRL8FJKrHc3Xv37u7d17FcV_rwc3H58oag4sjqbb7SCMbcQ5HMZw-zqRsU24qAEYwnU04tUoVH1JaV2tQILzaYO5RpYUqtaoIjHJrds6n9iAyjOIzp-rUVpf8s8zydgKS83WX8xVWV6eSa2kw_xkvhI1tyN0Cou6zOBKhEdAJfBQG1kHtLiOAGN6CoeB-TdAIVJWlqgwDykDna_mGGw85q59S_EXPUWwc1wuj34xPhEeReuPct56S8u59LedrVRXT7Tcgi3j_R5ooG0FOHczqy6Ib19R8 "Per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9EQy50QLLMqP9ReeC0Ve4bW5wSGfkJ3ujjWqHuGp3KLMVtDkeb8v1OHhBlzoaPkOeBQHhuitsMysVeYEuzG7S-F1vImPw2aOmSCVCzu3O8oxTFCFl5Ogob9MAg-E6sH9QHg-dDq8GfGClPcU0CllhOxcCQwJU4fSmp8pcb5J4J-ffwH8aeF4ZUYIOtawZnpJNeVjdmliNjsKnebYEPpvxWlc2zJSf805g7vfg-1ta2MrsF03Gp2PwrPzt0fjwQl9pKjp12ivxcSQZc2e2GD4q7Omu5r-OL9txBsmuXoeWqv3psZKS8bIKr71hjYCyz1tTkRziTNjObBNJPjTYf4H-O33Xvdlz6z_Aw "C++ (GCC) - Attempt This Online") - PCRE2 v10.40+
Takes its input in unary, as the length of a string of `x`s. Returns its output as the number of ways the regex can match. (The rabbit emoji indicates this output method.)
This simply enumerates all the partitions. In order to count unordered partitions, it enforces that partitions occur in strictly nondecreasing order. This is accomplished by starting with an arbitrary-sized partition on the first iteration, and adding an arbitrary nonnegative integer to the partition size on each iteration. At the end, `$` asserts that the cumulative sum is equal to the input number.
```
                    # tail = N = input number; no need to anchor, because the
                    # following loop is forced to do at least one iteration,
                    # and its first iteration has an anchor.
(                   # \1 = sum of the following:
    (
        \1          # Previous value of \1, if set
    |           # or
        ^           # 0, if this is the first iteration
    )
    x*              # Any arbitrary nonnegative integer
)+                  # Iterate the above any positive number of times
$                   # Assert tail == 0
```
Alternative 12 bytes:
```
(\1x*|^x*)+$
```
[Try it online!](https://tio.run/##RU9BasMwELznFYtYghTbiVzIJbJiB9JrT701qUhNAgI1cSUXXBT12Af0if2IKzuFXpad2dmd2eZozbJ//QC0Ary51AcDuBARymK7edysw@R0sRSd5KJYC@ZBnyJivrH63ALZnYkIUBnpGqNbSjKSuvcX18YVlWZ5mrPj2yAq/1keebZCxcRwy0XHg61Mccd8ZZ7yvYyV70WYAIzO@o9AXchRELskYR7rGAko6UiHmsnPBS1XaBktS58kWKc8sOEPN52OUcek8Y1cwC066jmBn69vIHOso/AaRyEodf@wVaqnu7ybXZ@7GUuw73m25L8 "Perl 5 ‚Äì Try It Online") - Perl v5.28.2 / [Attempt This Online!](https://ato.pxeger.com/run?1=RU-xTsMwEBVrN_7gZFlV3CStg4SE6rhJpbIysdFilaiRLJk22KkU5JqRD2Bl6VA2voiRL8FJKrHc3Xv37u7d56naaHX8ubh8fgWsGVi1K9YK8IR5yNPF_H4-c4NypwNsOGXpjBELsvSI2ErLbQ1ouUXMQa64qZSsAxSjyOyfTO1HRBQnUUI2L60o-2ep58kUC8LaXcZfXOtcpVfE5uohWXEf6Yq5AUB3WZ4JLFPeCXwVhsTiwluCADWowZLwt0mQTbEmQZbZMMRFRB1p_zDDYWe1c-rfSBj01rEcI_h9_wA0xoUXHnzLOSFu7xZCfO3rMr75DpZJMzo8NiMS4p46ntOJxte0r_8A "Perl - Attempt This Online") - Perl v5.36+  
[Try it online!](https://ato.pxeger.com/run?1=hVZLb9tGED4W0K8YM629S1Gp6CCBIZo2HFmADSRyoMhoGlklaHIpEaGWBLmMH62v_QG99tJDe2t-UHvs3-ilsw9JtCWghEXtY-ab1zcj__olKrK6kp9gFkVfJlYnK6KS7XcOrOlfo2cxS1LO4F1_NNgP-heng-ByeD4Ovjs_HZ_BQetZyqOsjhkcKqXn86NWNA9LCIrJFHwYWa9vbj5dv6i_v7v7MJ6_upmTP2qRdA7-JFfurf3TD7c2bX-tj_7-6l_6VNpywC78oGi7XsNUJcqUz6St9Vma4ykLF0cbcketlAsocCkCVpZ5SaKcVwKUn_aCVVU4YxR-rETc60UoAYeHYI7lUp0zHmcelEzUJQfXe9jAlPsoj5kD13meQe4nYVZJWGXGwE32X76aei3AJ02AqJQFM2YwAiNFNA7ROb_sn52MDmxqLh2o0nuWJ2Tl-LfLk4Y8pVRZkQ_J4VgHEeW1gB6sAqUyPEupgfKgB9aT4JWyZaGWdcUtuspHgnyZ60hWSWk9tGpepTPOYshyPtOvkFc3rPRUwhZ3QRRmGbphYje74DrLo09gRw58ztMY7DgUIeZOJkkuwfeByBub7q4xqMFut1eV6ZrKLMKUEwRQDhYTJELGOClox536XU-HoNkBReRb5Lhnebhq-4X-sig57uNnh-J5jYgv9gOBRUVdCT_DhYJuAqW8qIVUV4FhCcEu2XK_CEU0D1Qs9nqt0UpW1ZlwdAk802rvzz8O1EmSVAwvMV4MYSbmjwTs_DOLBGqZSmDLLe0vijRjxJDi_bvxiBbR8yhAZwl1DMbHwegiGA9Gb8-HJ-PB6fJ48GE8GJ7K_a7yyXwbT7p0zeCdEgloct_sBvU2co3Q_Y1sBLgPBQuSMl8ERSgEKzkpkeXDyzdvDEBTB1tXsFuBSVyu_G33BpZsoGAEKwouIZwGL51tPHsKoE1l6SJtgnRc6jWEYlaI_xUqWVSXVZrzrYLKbJKXoKbL_Yq5ODEyHMpEN3LKHc096i0Zr8qDKryL6QlFnhIlsCw_1p-7DhR5hdf6Bod8TPY6e8aofLgrc4syO36T570el4fHW3ChreTb4FIcGLy7xtKzVprj7EbvJtxtu1MPh80CM0EqB_Zu96RjmKAKL6d-Q3-VhNTnsgcPfe560G6nzYiXpLyngE5JI2TvimNImDqUVvxMiPVNDP_8_AvgT0uKV3qEoGMNa7qXZFM-ZpciZrOj0OkUG0L9rTmNa1NG6m04p3EPu7C7a2zs-KbrRqOLUTC8eHsy7p_RR4qKfo32Wk4MUdbsiQ2Gvzobuuvpj_PbRLxlksvnobV-b2uspGSMrOPbbGgtsNrT5kTUlzgzVgNbR4I_Hfp_gN9-73ZedvX6Pw "C++ (GCC) - Attempt This Online") - PCRE2 v10.40+
# Regex `üêá` (Raku`:P5`), 13 bytes
```
^(\1x*|^x+)*$
```
[Try it online!](https://tio.run/##K0gtyjH7X1qcquDr7@ftGmmt4Brm6KMQGF2cWKmgraGhXqFeoRKvWVeXa5VaYRVgqh@rUKegYpuWmZdZnAFkBkbrayqk5RcpxBkbWMdac0Fl/sdpxBhWaNXEVWhraqn8/w8A "Perl 6 ‚Äì Try It Online")
```
^                   # tail = N = input number
(                   # \1
    # If on an iteration after the first:
    \1x*            # \1 += {any arbitrary nonnegative integer}; tail -= \1
|
    ^               # Anchor to start, to assert this is the first iteration.
    x+              # \1 = {any arbitrary positive integer}; tail -= \1
)*
$                   # Assert tail == 0
```
Raku's Perl 5 compatibility mode is rather inaccurate, and prevents the 12 byte regex from working, apparently because there is nothing preventing a zero-width match from looping infinitely.
# Regex `üêá` ([RME](https://github.com/Davidebyzero/RegexMathEngine/) / Perl / PCRE), ~~29~~ 20 bytes
```
((?=(\3|^))(\2x*))+$
```
[Try it on replit.com](https://replit.com/@Davidebyzero/regex-Unordered-partitions-PerlPCRE) - RegexMathEngine  
[Try it online!](https://tio.run/##RU9BTsMwELz3FZa1qrwkaZ2iXuq4SaVy5cSNFKtErWTJtMEuUpBrjjyAJ/KR4AQkLqud2dmd2fZgzbJ/eSdgBfHm3OwNgbmIUBbbzcNmHSbHs2XgJBfFWqAn@hgR@tbq04XQ@kRFIJWRrjX6wmhGU/f27C5xRaVZnuZ4eB1E5T/LI48rUCiGWy467m1ligX6yjzmOxkr34kwIWR01n8E6EKOgtglCXpoYiTCaEc70Cg/5qxcgUVWlj5JoEl5wOEPN52OUcek8Y1ckN/ooGeUfH9@ETqDJgqvcRSCUnf3W6V6xkrJ6tvrEyKrF90NYgJ9z7Ml/wE "Perl 5 ‚Äì Try It Online") - Perl v5.28.2 / [Attempt This Online!](https://ato.pxeger.com/run?1=RU_NSsNAEMZrb77BsCxlxyRtUhGkm21SqNeevJm61NDAwtrGTQqRNB59AK9eeqhv4NN49EncJAUv8_PNNzPf93nKN0Yffy4un1-BGg613qVrDXTMbSvCxfx-PmsG2c4wWgifhzOONajMdljnRm1LIMmW8AZiLYpcq5IRj7jF_qko7Yp0vcANcPPSkqJ_1Lc4TqlE3t4q7Me1iXU4wTrWD8FK2OiveDMA6D6rM0BVKDqCrRwHa5paScBIRSqqULyNWTSlBlkU1Y5DU9dvsPVRDIed1E6ptRFw6KVTNSLw-_4BZERTSzzYUdNIebdcSPm1Lz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/NDY73mBy0D6xR9Yiuyi3K7Pl1nvd6Qh0OduBCS8u3oEtxYIjOBsvMWmVOsHuzuxHdVnfq4bBZYCZI6cLBw4FyDBNU4uXUr@mvk8B9oXqw74uuB60Wr0e8IuUTBXRKGSEHtwJDwtShtOZnQpyfY/jnr78BPy0cr8wIQcdq1kwvqaZ8yS5NzHpHodMcG0L/bTiNa1tG6m05Z3D7Hdjftzb2fNt14/HVOLi8@nQ6GZ7TF4qafrX2Wk0MWVTslQ2GX50t3c30x/ltI94xydXz3Ni8dzVWUjBGNvFtN7QRWO9pfSKaS5wZ64FtIsFPx7LTftf5N0rScFYu26nWaR//Bw "C++ (gcc) ‚Äì Try It Online") - PCRE2 v10.33** / [Attempt This Online!](https://ato.pxeger.com/run?1=hVZLb9tGED4W0K8YM621K1GpZCOBIZo2HFuADSRyoMhoGlslaHIpLUItCXIZPxJf-wN67aWH9phb_0x77N_opbMPSbQloIRF7WPmm9c3I__6NcrTqlSfYBpFXy-dTppHBdvp7DmTv0bPYpZwweDt8WiwExyfnwyCi-HZOPjh7GR8CnuNZ1xEaRUz2NdKz2cHjWgWFhDklxPwYeS8urn5eL1b_Xh39348e3kzI39UMuns_UnIoU-udr_8RCm52rltUdr-1lz9_c2_9KmW40Ir94O83fNqJktZcDFVNldnPMNTFs4P1uQOGlxIyHEpA1YUWUGiTJQStL-tOSvLcMoofC5l3O9HKAH7-2CP1VKfMxGnHhRMVoWAnvewhqn2URYzF66zLIXMT8K0VLDajIW73HnxcuI1AB-eANGpC6bMYgRWihgcYnJ_cXx6NNprUXvpQsnvWZaQpePfL05q8pRSbUU9JINDE0SUVRL6sAyUqvAcrQbagz44T4LXyo6DWs6VcOgyHwnyZmYiWSal8dCoRMmngsWQZmJqXqEob1jh6YTN74IoTFN0w8Zud8F1mkUfoRW58CnjMbTiUIaYO5UktQTfB6JuWnR7hUEtdru9rEzXVmYeckEQQDuYXyIRUiZITju9id_1TAiGHZBHvkMO-46Hq7afmy-HksNj_GxRPK8QcXcnkFhU1FXwU1xo6DoQF3kllboODEsIrYIt9vNQRrNAx9JarQ1awcoqla4pgWdb7t3Zh4E-SZKS4SXGiyFM5eyRQCv7xCKJWrYS2HoL-_Ocp4xYUrx7Ox7RPHoeBegsoa7F-DAYnQfjwejN2fBoPDhZHA_ejwfDE7Xf1j7Zb-tJl64YvFUgAW3u692g31auFrq_lo0A96FkQVJk8yAPpWSFIAWyfHjx-rUFqOtg60p2KzGJi5W_6d7CkjUUjGBJwQWEW-Olu4lnTwGMqZTPeR2k06NeTShmufxfoYJFVVHyTGwU1GaTrAA9Xe6XzMWJkeJwJqaRuXAN96i3YLwuD6qILqYnlBknWmBRfqy_6LmQZyVemxsc9jFpdprWqHpET-UWZbb8Os_7faEODzfgQlvLt6FHcWCI7grLzFplTrAbs7sUvXZv4uGwmWMmSOlC87apHMMElXg58Wv6yyRwX6ge3PdFz4N2m9cjXpDyngI6pYyQ5pXAkDB1KK35mRDnuxj--fkXwJ8WjldmhKBjNWuml1RTPmaXJma9o9Bpjg2h_1acxrUtI_XWnDO4-13Y3rY2tnzbdaPR-SgYnr85Gh-f0keKmn619lpMDFlU7IkNhr86a7qr6Y_z20a8YZKr56Gxem9qrKRgjKziW29oI7Dc0_pENJc4M5YD20SCPx3mf4Dffu92XnTN-j8 "C++ (GCC) - Attempt This Online") - PCRE2 v10.40+
PCRE1, and PCRE2 up to v10.34, automatically makes any capture group atomic if it contains a nested backreference. To work around this, the capture is copied between `\2` and `\3` using only forward-declared backreferences.
This would also make the regex compatible with Python[`regex`](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/) and Ruby, but they have no way of doing `üêá` output without source code modifications.
```
                      # tail = N = input number; no need to anchor, because the
                      # following loop is forced to do at least one iteration,
                      # and its first iteration has an anchor.
(
    (?=
        (             # \2 = the following:
            \3        # Previous value of \3, if \3 is set
        |         # or
            ^         # 0, if on the first iteration
        )
    )
    (                 # \3 = the following, which is also subtracted from tail:
        \2x*          # \2 plus any arbitrary nonnegative integer
    )
)+                    # Iterate the above as many times as possible, minimum 1
$                     # Assert tail == 0
```
# [Perl](https://www.perl.org/), ~~37~~ 36 bytes (full program)
```
1x<>~~/((\1|^).*)+$(??{++$i})/;say$i
```
[Try it online!](https://tio.run/##RY5BTsMwEEWvYixLsUmaNhXd1EkaNkFdsGHRDZTKilxqybEt21JbQrrkAByRgxDcVojN6M/oaf4z3MrZoDTYM6uEenMg4gfDrWi58kzO565l1rfMN7uIAm24wnUCyyUkFOx3QnKcl6Rrdro1tD1WsnBGCo@jUZSgTWDEFruGSWYrmU9JV8nnbF2EOVn3YKstbo9oI64HGlJeXIhzjGPSOXYENQhL34NGasdxTf4t8otFdf/0sCrgEv4J3XC9xYSAq9W5QRZ5XQbUWKE8QDKB4PvzC0A6ZIe8PJ3GGL9kH68kvSUxwotFF8dI9GRMQz8SAw2iILxZYchgmsJ3mMANJJ3ljnuMVqTvh2x0N/3Rxgut3DB6nKWTbPIL "Perl 5 ‚Äì Try It Online")
Alternative 36 bytes:
```
1x<>~~/((\1|^).*)+$(??{++$\})/;print
```
[Try it online!](https://tio.run/##RZBLboMwEIavMrWsYBdCQtRsYiB0Q5VtF9mUNHKpaZDMQzZRHpQse4AesRehDlHVzbz0z8w3Uwsl5/1eC5i7U2/KoKzgwFWZlx8aLHGshcoLUTZcLha64KopeJPuLAbFCWeB3r@1vXf0w8tlQkjifb5S957amCyXrW3jpKMTVqu8bPqOQVWLksQOCleIMjjscimIH9I23VVFzYpTJANdy7wh1thy8NZo8ozolEuuIunPaBvJF28TGDvddJBVihiGbX4rMBP5waC4hrZNW81PEINJug5SWWlBYvpP4Q8U0ePz0zpAK8RAN7wR@BxM/9juRJURSuEGeF0mAz8OTRc@j0bDWSgpETM9HoMhBywdBD9f32AG4mwcEqPel@8iwwm7eYcZ8uv31gRx5LrojBy0RbRVQouG4DXtut4bP8x@AQ "Perl 5 ‚Äì Try It Online")
# [Perl](https://www.perl.org/) `-p`, ~~33~~ 32 bytes (full program)
```
1x$_~~/((\1|^).*)+$(??{++$\})/}{
```
[Try it online!](https://tio.run/##K0gtyjH9n5evUJ5YlJeZl16soJ5aUZBalJmbmleSmGNlVZybWFSSm1iSnKFu/d@wQiW@rk5fQyPGsCZOU09LU1tFw96@WltbJaZWU7@2@v9/Q4N/@QUlmfl5xf91CwA "Perl 5 ‚Äì Try It Online")
Can only take one input (followed by EOF) per run. See [Fibonacci function or sequence](https://codegolf.stackexchange.com/questions/85/fibonacci-function-or-sequence/223243#223243) for an explanation.
# [Raku](https://raku.org/), 29 bytes[SBCS](https://en.wikipedia.org/wiki/Windows-1252) (anonymous function)
```
{+m:ex:P5/^(\1.*|^.+)*$/}o¬πx*
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/WjvXKrXCKsBUP04jxlBPqyZOT1tTS0W/Nv/Qzgqt/9bFiZUKKvE6SgqP2iYpKOnoATWl5RcpGOrpGRv8BwA "Perl 6 ‚Äì Try It Online")
[Answer]
# JavaScript, ~~125~~ 121 bytes
```
n=>(z=(a,b)=>[...Array(a)].map(b))(++n**n,(_,a)=>z[F=z(n,_=>a%(a/=n,n)|0).sort().join`+`]=b+=eval(F)==n-1&!z[F],b=0)|b||1
```
[Try it online!](https://tio.run/##RY7BCoMwEER/pT207GpM9dTTCr34EyK6sVoUu5EoQsV/T6UIPQ7MzHs9LzzVrhvnSOyz8S15oRRWAlYGKc211g/n@AOMhX7zCAYRwlCCQBSUivfOmme0gqiSUr4A30iU4BajnqybAXVvO6nCqiATUrPwABkSSZRcz/uyUIZi3My2Jb62Mtmh0YN9wR98P8CHkcFfYkrb3el4P1Xovw)
Warning: time and space complexity is exponential. Works very slow for large numbers.
[Answer]
# JavaScript ES7, 69 Bytes
```
n=>(f=(i,s)=>i?[for(c of Array(1+n))f(i-1,s,s-=i)]:c+=!s)(n,n,c=0)&&c
```
[Try it online!](https://tio.run/##Tc8xbsJAEEDRqxgKe0ZrIztV5M0YpaThAohiZdb2JJu1NbuAENDmADliLuKEIlLqp1/8N3MyoRWeYhEmPlj5GP27vcw9zZ4a6Ag4D0gNr3fdKNAmY5e8ipgLVMojdsBFlYc8FMS4r1tFi4Dgc5@3VGKatnOgUp8HdhbAkVhzcOwtIC7IH53Dq5BbhclxhKzIUHMH4ElWzvo@Dtg83W4ctmYLTJORYDc@guzKPeIf2P/gm2pd1Q/GOMh4Xm78yTg@JGJ8b@tkqZx@fGh@IatZKbyGNJ2Ef2vUgSo9HWOIAqyy5PvzK8lUD4yo7/e5LJ5/AA "JavaScript (SpiderMonkey) ‚Äì Try It Online")
# JavaScript ES6, 71 Bytes
```
n=>(f=(i,s)=>i?[...Array(1+n)].map(_=>f(i-1,s,s-=i)):c+=!s)(n,n,c=0)&&c
```
[Try it online!](https://tio.run/##Tc8xbsJAEEDRqxgKe0ZrW3aqyJsxSknDBRCKVmZtJlkWa3YBIaDNAXLEXMQhRaTUT7/47@ZkQic8xiKMvLWyP/gPe5kGmjy10BNwHpBaXqzLsnwVMReolcdNuTcjvFHbAxd1HvJQECM2naJZQPC5zzuqME27KVClzzt2FsCRWLN17C0gzsgfncOrkCvD6DhCVmSouQfwJKWzfog7bJ9uNw4rswKm0UiwSx9B1tUG8Q/sf/BtvaibX8a4k8N5vvQn43ibiPGDbZK5cro/CGh@IatZKbyGNB2FHzXqQLUejzFEAVZZ8v35lWRqgMeZvt@nqnj@AQ "JavaScript (SpiderMonkey) ‚Äì Try It Online")
Time complexity O(n^n), so be careful (an obvious delay appears on my computer for `F(6)`)
[Answer]
# [Desmos](https://desmos.com/calculator), 64 bytes
```
p(n)=1+‚àë_{i=1}^{n^n}0^{(n-‚àë_{j=1}^njmod(floor(ni/n^j),n))^2}
```
[Try it on Desmos!](https://www.desmos.com/calculator/ddiicj7gwl?nographpaper)
This is `O(n^(n+1))`
## How it works
The value of `i` in base `n` encodes a partition by counting the multiplicity of each part.
For `n=8`, `i=81` encodes `[mod(81,8), mod(81//8,8), mod(81//8^2,8), ...] = [1,2,1]`, so that's 1 one, 2 twos, and 1 three, which gives the partition `1 + 2 + 2 + 3`
`mod(floor(ni/n^j),n)` is the number of parts of size `j`.
`‚àë_{j=1}^njmod(floor(ni/n^j),n)` is the sum of the parts
`0^{(n-sum)^2}` is an indicator for if `i` encodes a partition of `n`: it is 1 if the sum is n, otherwise 0
Summing `0^{(n-sum)^2}` over all valid `i` gives the number of partitions, excluding the n-ones partition `1+1+1....+1` because `i=n` encodes one 2, not n 1s, so we add 1 to the count.
# [DesModder](https://chrome.google.com/webstore/detail/desmodder-for-desmos/eclmfdfimjhkmjglgdldedokjaemjfjp?hl=en) Text Mode Beta 1, 73 bytes
```
p(n)=1+sum i=(1...n^n)({n=sum j=(1...n)(j*mod(floor(n*i/n^j),n)),else:0})
```
DesModder Text Mode avoids the pains of golfing Desmos LaTeX, but it's still a bit buggy, and the syntax is in flux. So some more development might end up with the following syntax for 64 bytes:
```
p(n)=1+sum(i=1...n^n,{n=sum(j=1...n,j*mod(floor(n*i/n^j),n)),0})
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 13 bytes
```
J√Üs√¶.:L;
1√á¬°·∏¢
```
[Try it online!](https://tio.run/##y0rNyan8/9/rcFvx4WV6Vj7WXIaH2w8tfLhj0f///w0NDAwA "Jelly ‚Äì Try It Online")
Takes 5 seconds to solve n = 1000 on TIO.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
The `≈í·πó` atom has recently been added, and it means "Integer partitions".
```
≈í·πóL
```
[Try it online!](https://tio.run/##y0rNyan8///opIc7p/v8///fFAA "Jelly ‚Äì Try It Online")
```
≈í·πóL   - Full program.
≈í·πó    - Integer partitions.
  L   - Length.
      - Output implicitly.
```
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), 2 [bytes](https://github.com/mudkip201/pyt/wiki/Codepage)
```
‚Üê·µ±
```
[Try it online!](https://tio.run/##K6gs@f//UduEh1s3/v9vaAAA "Pyt ‚Äì Try It Online")
Explanation:
```
‚Üê          Get input
 ·µ±         Number of partitions
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 3 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
√Ö≈ìg
```
[Try it online](https://tio.run/##yy9OTMpM/f//cOvRyen//xsaAAA) or [verify all test cases](https://tio.run/##yy9OTMpM/R/i6mevpPCobZKCkr3f/8OtRyen/9f5DwA).
**Explanation:**
```
√Ö≈ì   # Get all lists of positive integers that sum to the (implicit) input
  g  # Pop and push the length to get the amount lists
     # (which is output implicitly as result)
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `l`, 1 byte
```
·πÑ
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJsIiwiIiwi4bmEIiwiIiwiOCJd)
# [Vyxal](https://github.com/Vyxal/Vyxal), 2 bytes
```
·πÑL
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLhuYRMIiwiIiwiOCJd)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
≈ª·πó·∏ãRƒã
```
[Try it online!](https://tio.run/##y0rNyan8///o7oc7pz/c0R10pPv/4XbNyP//zQE "Jelly ‚Äì Try It Online")
Non-builtin solution using Henry Bottomley's comment at the top of the OEIS page. Although this obviously doesn't beat the builtin, I wouldn't be surprised if the same approach might be the shortest in some other array languages.
```
 ·πó       Generate every combination of n elements with replacement from
≈ª        [0 .. n],
  ·∏ã      dot product each with
   R     [1 .. n],
    ƒã    and count the occurrences of n.
```
This can also be thought of as encoding each unordered partition as an ordered list of the multiplicity of each integer.
[Answer]
# Java 8 (229 bytes)
```
import java.util.function.*;class A{static int j=0;static BiConsumer<Integer,Integer>f=(n,m)->{if(n==0)j++;else for(int i=Math.min(m,n);i>=1;i--)A.f.accept(n-i,i);};static Function<Integer,Integer>g=n->{f.accept(n,n);return j;};}
```
Ungolfed:
```
import java.util.function.*;
class A {
    static int j = 0;
    static BiConsumer<Integer, Integer> f = (n, m) -> {
        if (n == 0)
            j++;
        else
            for (int i = Math.min(m, n); i >= 1; i--)
                A.f.accept(n - i, i);
    };
    static Function<Integer, Integer> g = n -> {
        f.accept(n, n);
        return j;
    };
}
```
]