r/counting • u/TehVulpez tampermonkey addict • Oct 20 '25
Compositions
In this thread, we'll be counting the ways to add to an integer n using the integers c_1 + c_2 + ... + c_k, where each c_i >= 1, and k <= n. Ways to sum that are commutatively the same, as in 1+2 = 2+1, are different compositions. We'll be counting these compositions lexicographically for each segment of sum and length.
Here are the first few counts:
1
2
1,13
1,2
2,1
1,1,14
1,3
2,2
3,1
1,1,2
1,2,1
2,1,1
1,1,1,1
You can also abbreviate repetitions with superscript, for example 1,1,1,1,1,1,1,1,1,2,2,2,1 = 19 23 1
First get is at 11, the 1024th count.schedule
3
u/TehVulpez tampermonkey addict Oct 20 '25
1
3
u/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 20 '25
2
3
u/TehVulpez tampermonkey addict Oct 20 '25
1+1
3
u/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 20 '25
3
3
u/TehVulpez tampermonkey addict Oct 20 '25
1+2
3
u/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 20 '25
2,1
tfw i establish the precedent of plus-comma equivalency
2
u/TehVulpez tampermonkey addict Oct 20 '25 edited Oct 20 '25
1,1,1
thread just started and already there's a format war smhnvm fuck pluses, commas all the way2
u/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 20 '25
4
my mind is contagious
2
u/TehVulpez tampermonkey addict Oct 20 '25
1,3
if we make a partitions thread though I'll insist on pluses for that one
2
u/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 20 '25
2,2
why's that
→ More replies (0)
3
u/TehVulpez tampermonkey addict Oct 05 '26 edited Oct 06 '26
Thread Participation Chart for Compositions
| Rank | Username | Counts |
|---|---|---|
| 1 | miceee | 419 |
| 2 | TehVulpez | 344 |
| 3 | cuteballgames | 218 |
| 4 | PhosphorCrystaled | 39 |
| 5 | Expert_Bridge | 2 |
| 6 | davidjl123 | 1 |
| 6 | Multiconcepted | 1 |
It took 7 counters 9 days, 5 hours, 18 minutes, 43 seconds to complete this thread. Bold is the user with the get.
Total counts in this chain logged: 1024
3
u/miceee sicko thread artists collective Oct 05 '26
Btw does this now mean that compositions is finally getting its own stats page?
3
u/TehVulpez tampermonkey addict Oct 05 '26 edited Oct 06 '26
well I could make one since I do have wiki perms, but I don't currently have a script that automatically generates those wiki pages, and I'm not sure how much I want to mess with anti's domain. my userscript right now is pretty basic, it just generates the TPC and CSV files sort of like the old piyush/qualw python scripts but in the browser
3
2
u/TehVulpez tampermonkey addict Oct 05 '26 edited Oct 11 '26
/u/antichess log I'm not sure how useful this is to you since you have your own workflow, but idk maybe it'd save you some time. it's in the same schema as the COBIBH counting.sqlite file.
position,author,created_utc,comment_id,thread_id,bodyedit: I've fixed both the TPC and the log to include the first comment
1
u/TehVulpez tampermonkey addict Oct 22 '25 edited Oct 23 '25
def sums(t,l):
if l == 1: yield t,
else:
for x in range(1,t):
for s in sums(t-x, l-1):
yield (x,) + s
for t in range(1, 11):
for l in range(1, t+1):
for s in sums(t,l):
print(*s, sep=',')
4
u/TehVulpez tampermonkey addict Oct 22 '25
Get Schedule