1. Spiral Matrix Sum
Given a 2D square array of integers, you need to flatten the elements of the given matrix into a single list by traversing it in a spiral order, starting from the top left and moving clockwise. Then calculate the sum of the elements located at indices divisible by 3 (0-based) in this flattened list and return this sum. For example, if the matrix is [[1,2,3], [4,5,6],[7,8,9]], you should flatten them as 1,2,3,6,9,8,7,4,5, and then the sum is 1+6+7=14.