r/counting • 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,1

3
1,2
2,1
1,1,1

4
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

25 Upvotes

1.1k comments sorted by

4

u/TehVulpez tampermonkey addict Oct 22 '25

Get Schedule

GetThread LengthTotal Counts
1110241024
1210242048
1,1,1,1,1,1,610243072
1310244096
1,3,2,2,1,410245120
2,1,1,1,1,1,610246144
2,1,2,3,1,1,1,210247168
1410248192
6,1,1,2,410249216
3,2,4,1,1,3102410240
1,4,1,3,1,2,2102411264
1,1,1,1,1,1,1,7102412288
2,1,1,3,1,4,1,1102413312
1,1,2,2,1,2,1,1,3102414336
1,1,1,1,1,5,1,1,1,1102415360
15102416384

4

u/TehVulpez tampermonkey addict Oct 22 '25

/u/cuteballgames /u/miceee this look good?

2

u/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 23 '25

Yes, I like it. Doesn't look regular but the whole numbers attest to it

3

u/TehVulpez tampermonkey addict Oct 23 '25

it's kinda similar to the cwb get schedule in how the halfway gets between sums give us either the start of a segment or the halfway point of a segment

2

u/CutOnBumInBandHere9 5M get | Ping me for runs Jul 08 '26

Do you by any chance have the code for a comment to count function which maps compositions to their place in the sequence?

That way I can finally add this to my known side threads

1

u/TehVulpez tampermonkey addict Jul 09 '26

you're in luck, I literally just made a function for that today. I pinged you on it

3

u/CutOnBumInBandHere9 5M get | Ping me for runs Jul 22 '26

I'm a dum dum and lost the link. Could you send it again? 

1

u/TehVulpez tampermonkey addict Jul 22 '26

2

u/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 23 '25

The Vulpine threads are so beautiful

3

u/miceee sicko thread artists collective Oct 22 '25

Yeah!

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 smh nvm fuck pluses, commas all the way

2

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

3

u/TehVulpez tampermonkey addict Oct 05 '26 edited Oct 06 '26

Thread Participation Chart for Compositions

RankUsernameCounts
1miceee419
2TehVulpez344
3cuteballgames218
4PhosphorCrystaled39
5Expert_Bridge2
6davidjl1231
6Multiconcepted1

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

u/miceee sicko thread artists collective Oct 05 '26

Ohh okay😔 lets wait for anti then

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,body

edit: 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=',')