Not going to write it for you. How would you do it on paper? Take one new number at a time, for example:

can you see a period in 1?

What about in 1,7?

What about in 1,7,4?

What about in 1,7,4,13?

What about in 1,7,4,13,1? If yes, how do you know? Can you think of a way to write a test that a computer can work out? Is there any storage you might need?

Do you have to find a complete period twice to determine that there is a repeating pattern? For example 1,7,4,13,1,9,3,6 has a period > 4, but does the maths behind the calculation indicate that 1 must always be followed by 7, which must always be followed by 4 etc? What is (7^n) / (7^(n-1)) ?