class LoopDetection: def __init__(self,init,f): self.init=init self.f=f self.value=[] self.value_inv={} self.loop_start=-1 self.loop_length=-1 def IteratedComposition(self,n): L=len(self.value) if L<1:self.SetValue(self.init) if n