OFFSET
1,2
COMMENTS
Consider the 5-step recursion x(k) = (x(k-1)+x(k-2)+x(k-3)+x(k-4)+x(k-5)) mod n. For any of the n^5 initial conditions x(1), x(2), x(3), x(4) and x(5) in Zn, the recursion has a finite period. Each of these n^5 vectors belongs to exactly one orbit. In general, there are only a few different orbit lengths for each n. For n=8, there are 6 different lengths: 1, 2, 3, 6, 12 and 24. The maximum possible length of an orbit is A106303(n), the period of the Fibonacci 5-step sequence mod n.
LINKS
Eric Weisstein's World of Mathematics, Fibonacci n-Step Number.
PROG
(Python)
from itertools import count, product
def A106290(n):
bset, tset = set(), set()
for t in product(range(n), repeat=5):
t2 = t
for c in count(1):
t2 = t2[1:] + (sum(t2)%n, )
if t == t2:
bset.add(c)
tset.add(t)
break
if t2 in tset:
tset.add(t)
break
return len(bset) # Chai Wah Wu, Feb 22 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
T. D. Noe, May 02 2005
STATUS
approved