input: def find_positive_triples(n):
      """
      Given a positive integer n, an integer array a of length n needs to be generated.
          For every i (1 ≤ i ≤ n), the element a[i] should be calculated as i * i - i + 1.
          The goal is to find and return the count of triples (a[i], a[j], a[k]) which satisfy 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:     from itertools import combinations
  
      a = [i * i - i + 1 for i in range(1, n + 1)]
  
      count = 0
      for i, j, k in combinations(range(n), 3):
          if (a[i] + a[j] + a[k]) % 3 == 0:
              count += 1
  
      return count