In the link I posted, there are 8 or 9 variations on the same basic definition. In some cases, a cycle is allowed to repeat vertices, but a circuit is not. This is actually a problem with the field of graph theory and most authors take the time to define their words carefully since there isn't a consensus on what the definitions are. You should double check with your instructor that repeated vertices are not allowed, as you state in your problem, as some definitions mentioned on the Wikipedia page state that repeats are allowed.
In particular, the third definition on that page says:
* A closed directed walk, with repeated vertices allowed. (This usage is common in computer science. In graph theory it is more often called a closed directed walk.)
If you are absolutely sure that repeats are not allowed, you'd have to do something fancier than simple A^n. Several people asking similar questions on the 'net end up with variations on the DFS algorithm, where the structure of the matrix has no relevance to the way the problem is solved. If that is the case, then you'll want to start from square one and use one of those.
Additionally, if the answers you find here don't suffice, you might want to try it on mathoverflow.net.
When I answered this question last, I started scribbling something down that used matrix multiplication but didn't have the problem you mentioned. I wondered if it was possible to use matrix operations to find the cycles of length exactly 3 or 4. I think there is a way but it involves modifying the elements of your matrix, and I suspect that is not what they are looking for. But just for fun, this is what I came up with:
Take your matrix:
0 1 1 0 1
1 0 1 0 1
1 1 0 1 0
0 0 1 0 1
1 1 0 1 0
I would label the columns and rows by letters for each vertex
a b c d e
a 0 1 1 0 1
b 1 0 1 0 1
c 1 1 0 1 0
d 0 0 1 0 1
e 1 1 0 1 0
Then I would replace each 1 with an element like (a,b) where you match the row with the column to produce the edge (a,b). Make sure you do this in the correct order, since you are producing the underlying digraph from this graph.
So the first two rows would look like:
a 0 (a,b) (a,c) 0 (a,e)
b (b,a) 0 (b,c) 0 (b,e)
...
What use is this? Well, when you do your matrix multiplication, you want to perform + and * like this:
(a, b) * (b, c) = (a,b,c)
(a, b, c) * (c, b, b, a) = (a,b,c,b,c,a) = (a,b,c,a)
(a,b) + (a,b) = (a,b)
The * rule joins edges together to form longer walks. Reducing the walk (a,b) * (b,c) = (a,b,c) just makes it easier to read.
The rule (a, b, c) * (c, b, b, a) = (a,b,c,b,c,a) = (a,b,c,a) makes sure that hoping back and forth along the same path does not count as one long path. You'll need some function that would remove duplicates.
The rule (a,b) + (a,b) = (a,b) simply means not to count the same path twice.
When you're done, each entry should contain something like (a,b,c,a) + (a,d,a) + (a,e,d,a), which would represent the unique cycles from a back to a.
This really seems like a complication of the question your asking. The algorithm really doesn't seem like it would be very efficient, since not only are you using matrix multiplication, which isn't very fast by itself, but the reduction for each cell is non-trivial as well. I wouldn't recommend that people actually implement this ;) I just thought it was neat since you can solve this problem by creating a ring using * as string concatenation and + as disjoint sum.