Function Repository Resource:

FindNestPeriod

Source Notebook

Try to find the repetition period for nesting of a function

Contributed by: Richard Phillips

ResourceFunction["FindNestPeriod"][f,expr]

attempts to find the repetition period for applying f repeatedly starting from expr.

ResourceFunction["FindNestPeriod"][f,expr,n]

tries at most n times.

Details and Options

ResourceFunction["FindNestPeriod"][f,] uses SameQ to compare results of applying the function f.
If the period is not found, ResourceFunction["FindNestPeriod"] returns a Failure object.

Examples

Basic Examples (2) 

Find the period for successive nesting of a function:

In[1]:=
ResourceFunction["FindNestPeriod"][Mod[#^2, 11] &, 3, 4]
Out[1]=

If the period is not found, FindNestPeriod returns a Failure object:

In[2]:=
ResourceFunction["FindNestPeriod"][# + 1 &, 1]
Out[2]=

Version History

  • 1.0.0 – 16 December 2019

License Information