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