OFFSET
3,3
COMMENTS
Also the maximum number of lines for n points in F_3^3 where a line is defined as three points p, q, r such that p+q+r = 0.
LINKS
Justin Stevens and Duncan Wilson, The Maximum Number of Sets for 12 Cards is 14, arXiv:2501.12565 [math.CO], 2025.
EXAMPLE
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.
PROG
(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))
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Justin Stevens, Jan 22 2025
STATUS
approved
