[go: up one dir, main page]

login
A367477
a(n) is the least k such that all possible modular classes a Fibonacci number can take mod n is seen in the Fibonacci numbers Fibonacci(1)..Fibonacci(k).
0
1, 3, 4, 6, 9, 12, 12, 10, 16, 21, 10, 22, 18, 36, 20, 22, 24, 18, 18, 52, 14, 30, 36, 22, 49, 60, 52, 44, 14, 60, 30, 46, 38, 24, 76, 22, 54, 18, 46, 58, 30, 36, 64, 30, 92, 36, 24, 22, 80, 147, 66, 74, 76, 52, 18, 44, 70, 42, 58, 118, 42, 30, 44, 94, 102, 114, 96
OFFSET
1,2
COMMENTS
In verifying if k is in A367420 we only need to look from 1 to a(n) to see if there is a Fibonacci number f that has a remainder of k when dividing by 2*k.
EXAMPLE
The remainders of Fibonacci numbers mod 4 (starting at Fibonacci(1) = 1) are 1, 1, 2, 3, 1, 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 3. The distinct values are {0, 1, 2, 3}. The least k such that the remainders of Fibonacci numbers mod 4 contain all these values is 6 as the first 6 remainders are 1, 1, 2, 3, 1, 0.
PROG
(PARI)
a(n) = {if(n == 1, return(1));
my(rems = vector(n^2), v = [1, 1]);
rems[1] = 1;
for(i = 2, n^2,
rems[i] = v[2];
v = [v[2], v[1]+v[2]]%n;
if(v == [1, 1],
break
)
);
s = Set(rems);
for(i = 1, #rems,
s = setminus(s, Set(rems[i]));
if(#s == 0,
return(i)
)
)
}
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, Nov 19 2023
STATUS
approved