Fix a bug on per

When the first and second elements were the same but did not constitute
a period the algorithm was dropping one of them, which would make it
consider numbers such as
(11/98)=0.1(12244897959183673469387755102408163265306) as having
periods.

While these are actually considered periods, this is not what the the
professor wanted - he wanted a simpler behaviour in the implemented
function.