r/counting • sliiiiide the bits • 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

5

u/TehVulpez sliiiiide the bits Oct 22 '25

Get Schedule

Get Thread Length Total Counts
11 1024 1024
12 1024 2048
1,1,1,1,1,1,6 1024 3072
13 1024 4096
1,3,2,2,1,4 1024 5120
2,1,1,1,1,1,6 1024 6144
2,1,2,3,1,1,1,2 1024 7168
14 1024 8192
6,1,1,2,4 1024 9216
3,2,4,1,1,3 1024 10240
1,4,1,3,1,2,2 1024 11264
1,1,1,1,1,1,1,7 1024 12288
2,1,1,3,1,4,1,1 1024 13312
1,1,2,2,1,2,1,1,3 1024 14336
1,1,1,1,1,5,1,1,1,1 1024 15360
15 1024 16384

4

u/TehVulpez sliiiiide the bits Oct 22 '25

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

3

u/miceee sicko thread artists collective Oct 22 '25

Yeah!

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 sliiiiide the bits 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/cuteballgames Sum 13: 016, 037, 035, 045, 127, 135, 134, 124, 13, 25 Oct 23 '25

The Vulpine threads are so beautiful

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 sliiiiide the bits 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 sliiiiide the bits Jul 22 '26

3

u/TehVulpez sliiiiide the bits 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 sliiiiide the bits 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 sliiiiide the bits 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 sliiiiide the bits 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 sliiiiide the bits 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 sliiiiide the bits 10d ago edited 9d ago

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 10d ago

Btw does this now mean that compositions is finally getting its own stats page?

3

u/TehVulpez sliiiiide the bits 10d ago edited 10d ago

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 10d ago

Ohh okay😔 lets wait for anti then

2

u/TehVulpez sliiiiide the bits 10d ago edited 5d ago

/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 sliiiiide the bits 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=',')