I'm currently working on a project that deals with numerical semigroups and their connection to matrices. I'm pretty new to Mathematica, so I wouldn't be surprised if my question has a simple solution; nevertheless I can't find it haha!
I need code that will check the entries in a matrix to see if any of them are zero, and if there is at least one zero in the matrix, take the next power of the matrix and check it again until all of the entries are non-zero. All of the matrices I am working with WILL become completely non-zero, so I don't need to worry about an infinite loop or anything. I was thinking that I could just multiply all of the elements in the given matrix and if the product = 0, then loop back through. Either that or scan elements of the matrix individually since the matrices aren't any bigger than 5 x 5.
Any help is greatly appreciated!
P.S, -- If anyone has a method of then checking individual elements of a matrix to see if they are nonzero, and if they are, then adding the current power of that matrix to a set of numbers, I would be grateful to hear how it could be done. This is secondary to the above question though.