Let A be a square diagonal matrix (n by n). Let the only elements on its diagonal to be +1 or -1. Alternating sign is allowed. For example, if n = 2. We consider A = [1,0; 0, -1] to be an ideal one. But I noticed A = [-1,0; 0,1] is as same as A = [1,0 ; 0, -1].
Question: If A (n by n) does not equal to the Identity matrix. How many distinct such matrix A exist? Please answer this in terms of n.'