OFFSET
1,1
COMMENTS
Composite n such that Q^(n-1) = I (mod n), where Q is the Fibonacci matrix {{1,1},{1,0}} and I is the identity matrix. The identity is also true for the primes congruent to 1 or 4 (mod 5), which is sequence A045468. The period of Q^k (mod n) is the same as the period of the Fibonacci numbers F(k) (mod n), A001175. Hence the terms in this sequence are the composite n such that A001175(n) divides n-1. [T. D. Noe, Jan 09 2009]
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000 (first 200 terms from T. D. Noe)
Eric Weisstein, MathWorld: Fibonacci Q-Matrix.
MATHEMATICA
Select[Range[2, 50000], ! PrimeQ[ # ] && Mod[Fibonacci[ # - 1], # ] == 0 && Mod[Lucas[ # ] - 1, # ] == 0 &]
PROG
(Python)
from itertools import islice
from sympy import nextprime
def A094401_gen(): # generator of terms
def f(n, m): # return fibonacci(n-1) mod m and fibonacci(n) mod m
a, b, c, d, a2, b2, c2, d2 = 1, 1, 1, 0, 1, 0, 0, 1
for x in bin(n)[2:]:
e, f = b2*c2%m, k if (k:=a2+d2)<m else k-m
a2, b2, c2, d2 = (a2*a2+e)%m, b2*f%m, c2*f%m, (d2*d2+e)%m
if x=='1':
a2, b2, c2, d2 = (a2*a+b2*c)%m, (a2*b+b2*d)%m, (c2*a+d2*c)%m, (c2*b+d2*d)%m
return d2, c2
p, q = 4, 5
while True:
for m in range(p, q):
a, b = f(m, m)
if not a and b == 1:
yield m
p, q = q+1, nextprime(q)
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Eric Rowland, May 01 2004
EXTENSIONS
More terms from Ryan Propper, Sep 24 2005
STATUS
approved
