cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

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

Views

Author

David A. Corneth, Nov 19 2023

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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)
    		)
    	)
    }