News for hackers. Stuff that matters.
Re:Lessons learned from sharding Postgres at Notion by infogulch on Wednesday October 06, 2021 @03:43PM (#28777442)
Numberphile made a video about "highly composite numbers" / "anti-primes", which are numbers that have more factors than all smaller numbers. https://youtu.be/2JM2oImb9Qg

There is an oeis sequence of them that starts "1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720, 840...", which notably does not include 480. https://oeis.org/A002182

Re:Lessons learned from sharding Postgres at Notion by alberth on Wednesday October 06, 2021 @03:50PM (#28777551)
That’s super interesting. It’s counterintuitive but 480 has the same # of factors that 360 has (which is 24 factors)

https://www.calculatorsoup.com/calculators/math/factors.php

Re:Lessons learned from sharding Postgres at Notion by ulucs on Wednesday October 06, 2021 @04:23PM (#28777962)
so it's weakly highly composite?
Re:Lessons learned from sharding Postgres at Notion by smolder on Wednesday October 06, 2021 @06:03PM (#28779067)
I think you can still say it's highly composite, but doesn't qualify as an anti-prime when it isn't the lowest number with that many factors.
Re:Lessons learned from sharding Postgres at Notion by infogulch on Thursday October 07, 2021 @01:27AM (#28782415)
"anti-prime" is just Brady trying to rebrand an old boring name to sound cooler (as he does). "highly composite" has a perfectly well defined meaning already, trying to shift it to shoehorn in some artificial distinction between it and "anti-prime" is counterproductive. If the aim is to produce a more descriptive name for a similar sequence of numbers that includes 480, I think GP's "weakly highly composite" is much better. I might propose just "weakly composite" or "mediocrely composite".

Edit: Actually, this was (also) already done by Ramanujan and has a better name than any proposed here: http://oeis.org/A067128 - "largely composite numbers" which does in fact contain 480. Perhaps every sharded system should choose a shard count from this list?

Re:Lessons learned from sharding Postgres at Notion by smolder on Thursday October 07, 2021 @06:11AM (#28784358)
Thanks for correcting me, but I don't think drawing a distinction between "anti-prime" (clearly specific) and "highly composite" (vague) is counterproductive. On the other hand, "highly" and "largely" mean roughly the same thing, so treating "highly composite" and "largely composite" as distinct in this way is linguistically counterintuitive and counterproductive. Likewise, "weakly highly" reads like ambiguous nonsense when you don't go out of your way to specially define it.
Re:Lessons learned from sharding Postgres at Notion by jedberg on Wednesday October 06, 2021 @04:05PM (#28777738)
It's true that 480 isn't on the list, but you'll notice there is a big skip in the list between 360 and 720, so if you want something in between, 480 is a good choice since it's still a multiple of 12.
Re:Lessons learned from sharding Postgres at Notion by infogulch on Wednesday October 06, 2021 @04:15PM (#28777859)
Yeah, to be clear, I think there are many important factors that go into choosing a shard count, and blindly jumping to something just because it's some platonic mathematical ideal seems naive. I just thought this is a neat related fact and is probably a good starting point if you're in the process of choosing a shard count.
Re:Lessons learned from sharding Postgres at Notion by moralestapia on Wednesday October 06, 2021 @05:22PM (#28778629)
This is the kind of engineering that it's almost impossible to screen in interviews (particular for HR-minded pals) and is a big part of what makes a 10x-100x engineer (which definitely DO exist).

Obviously not this thing just by itself, but this sort of knowledge, applied to everyday decisions that get compound over time.

Re:Lessons learned from sharding Postgres at Notion by mikepurvis on Wednesday October 06, 2021 @03:48PM (#28777531)
But 480 is 2*240, so it's definitely a close contender.
Re:Lessons learned from sharding Postgres at Notion by karakot on Wednesday October 06, 2021 @08:20PM (#28780172)
there is a factorial sequence in it, makes sense. 24, 120, 720...
Re:Lessons learned from sharding Postgres at Notion by varyherb on Thursday October 07, 2021 @02:17AM (#28782815)
Not to mention 1, 2, and 6 :)

7! = 5040 shows up as well in the OEIS sequence. Buuut, 8! = 40320 does not...too many useless 2's in the prime factorization?