Period of first differences by I., S.

import Data.List
m@main=getLine>>=putStrLn.drop 5.show.minimum.init.f.g.map read.words>>m
f x=map(#tails x)$inits x
x#y=elemIndex x$y++[x]
g x=zipWith(-)x$tail x

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page