🌐 Website: https://fuglede.dk
👨💻 GitHub: https://github.com/fuglede/
pos = set()
for c in map(frozenset, itertools.combinations(range(n), k)):
if all(len(a ^ c) != 2 for a in pos):
pos.add(c)
return pos
def cat(n):
return 1/(n+1)*math.comb(2*n, n)
Q: For which k > 0 are
len(all_pos(2*k, k - 1)) == cat(k)/2?
pos = set()
for c in map(frozenset, itertools.combinations(range(n), k)):
if all(len(a ^ c) != 2 for a in pos):
pos.add(c)
return pos
def cat(n):
return 1/(n+1)*math.comb(2*n, n)
Q: For which k > 0 are
len(all_pos(2*k, k - 1)) == cat(k)/2?
swapple.fuglede.dk
swapple.fuglede.dk
www.dr.dk##.dre-teaser […]
[Original post on mastodon.social]
www.dr.dk##.dre-teaser […]
[Original post on mastodon.social]
mastodon.social/@fuglede/113...
mastodon.social/@fuglede/113...
I will be sharing my own Python solutions on github.com/fuglede/adve...
#adventofcode #python
I will be sharing my own Python solutions on github.com/fuglede/adve...
#adventofcode #python