OFFSET
1,2
COMMENTS
This sequence differs from the corresponding Fibonacci sequence (A106302) at n=1 and 5 because these correspond to the primes 2 and 11, which are the prime factors of -44, the discriminant of the characteristic polynomial x^3-x^2-x-1. We have a(n) < prime(n) for the primes 2, 11 and A106279.
For a prime p, the period depends on the zeros of x^3-x^2-x-1 mod p. If there are 3 zeros, then the period is < p. If there are no zeros, then the period is p^2+p+1 or a simple fraction of p^2+p+1. Also note that the period can be prime, as for p=3, 5, 31, 59, 71, 89, 97, 157, 223. When the period is prime, the orbits have a simple structure. [From T. D. Noe, Sep 18 2008]
LINKS
Eric Weisstein's World of Mathematics, Fibonacci n-Step Number
FORMULA
a(n) = A106293(prime(n)).
MATHEMATICA
n=3; Table[p=Prime[i]; a=Join[Table[ -1, {n-1}], {n}]; a=Mod[a, p]; a0=a; k=0; While[k++; s=Mod[Plus@@a, p]; a=RotateLeft[a]; a[[n]]=s; a!=a0]; k, {i, 60}]
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, May 02 2005
STATUS
approved