A380167 Maximum number of sets for the SET card game for n cards with 3 properties where each can take 3 values.
1, 1, 2, 3, 5, 8, 12, 12, 13, 14, 16, 19, 23, 26, 30, 36, 41, 47, 54, 62, 71, 81, 92, 104, 117
Offset: 3
Examples
For n=3, the maximum number of SETs with 3 cards is 1 hence a(3)=1. For n=4, no additional SETs can be formed, hence a(4)=1. For n=5, we can take a 3-card SET, say {p, q, r}. Then, for two additional cards, s and t, outside of the SET, the only possible way this can form a SET is if we have one element from the first SET plus s and t form a SET. An example of this with the 4 properties being coordinates from 0 to 2 in mod 3 (in the equivalent definition of a SET) is the points {(0, 0, 0, 0), (0, 0, 0, 1), (0, 0, 0, 2), (0, 0, 1, 0), (0, 0, 2, 0)} which form 2 SETs. Hence a(5)=2.
Links
- Justin Stevens and Duncan Wilson, The Maximum Number of Sets for 12 Cards is 14, arXiv:2501.12565 [math.CO], 2025.
- Jim Vinci, The maximum number of sets for n cards and the total number of internal sets for all partitions of the deck, 2009.
Crossrefs
Programs
-
Python
from itertools import combinations def add_mod3(a, b, c): """Component-wise addition mod 3 of two 3D tuples.""" return tuple((a[i] + b[i] + c[i]) % 3 for i in range(3)) def is_set(a,b,c): """Returns true if three elements form a set.""" return add_mod3(a,b,c) == (0,0,0) if _name_ == "_main_": all_points = [(x,y,z) for x in range(3) for y in range(3) for z in range(3)] max_sets = 0 for n in range(3, 28): for comb in combinations(all_points, n): num_sets = 0 for possible_set in combinations(comb, 3): if is_set(possible_set[0], possible_set[1], possible_set[2]): num_sets += 1 if num_sets > max_sets: max_sets = num_sets print("Max sets for %d cards: %d"%(n, max_sets))
Comments