AIME II 2026 (Problem 15)

Find the number of ordered 7-tuples (a1,a2,a3,…,a7)(a_1,a_2,a_3,\ldots,a_7) having the following properties:

• ak∈{1,2,3}a_k\in\{1,2,3\} for all kk.

• a1+a2+a3+a4+a5+a6+a7a_1+a_2+a_3+a_4+a_5+a_6+a_7 is a multiple of 33.

• a1a2a4+a2a3a5+a3a4a6+a4a5a7+a5a6a1+a6a7a2+a7a1a3a_1a_2a_4+a_2a_3a_5+a_3a_4a_6+a_4a_5a_7+a_5a_6a_1+a_6a_7a_2+a_7a_1a_3 is a multiple of 33.