input: def find_triplets_multiples_of_three(n):
      """
      Given a positive integer n, construct an array a of size n such that:
          For each i (1 ≤ i ≤ n), compute a[i] = i * i - i + 1.
          Calculate and return the count of triples (a[i], a[j], a[k]) where i < j < k, 
      and the sum a[i] + a[j] + a[k] is divisible by 3.
  
      Example:
          Input: n = 5
          Output: 1
          Explanation:
          a = [1, 3, 7, 13, 21]
          The only valid triple is (1, 7, 13).
      """
output:     
      a = [i * i - i + 1 for i in range(1, n+1)]
      count = 0
      for i in range(n):
          for j in range(i+1, n):
              for k in range(j+1, n):
                  if (a[i] + a[j] + a[k]) % 3 == 0:
                      count += 1
      return count
  