Count the cycles of lenghts 4 and 6 in the d-dimensional cube.

Note: Acycleis a path such that the start vertex and end vertex are the same.

So im assuming I have to come up with a formula for each case but I have no idea how to do it. Please help.