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.

Showing 1-2 of 2 results.

A386277 For n >= 0, a(n) is the least Fibonacci number F_i (A000045) such that for some k >= 0, F_i = (n + 1)*(n + 2*k)/2, or a(n) = -1 if no such k exists.

Original entry on oeis.org

0, 1, 3, 34, 55, 21, 21, -1, 144, 55, 55, -1, 377, 987, 6765, 2584, 2584, -1, 2584, 610, 987, 6765, 46368, -1, 75025, 377, 14930352, -1, 317811, 6765, 832040, 14930352, 6765, -1, 102334155, -1, 4181, -1, 317811, -1, 6765, 987, 701408733, -1, 1548008755920, -1, 2178309, -1, 225851433717
Offset: 0

Views

Author

Ctibor O. Zizka, Jul 17 2025

Keywords

Comments

n even: F_i exists for all even n. Proof: For n even we have (n*(n + 1)/2) mod (n + 1) = 0. The residue 0 is among the residues of the Pisano period of (Fibonacci sequence mod (n + 1)) for all n.
n odd: F_i exists only if the residue (n*(n + 1)/2) mod (n + 1) = (n + 1)/2 is among the residues of the Pisano period of (Fibonacci sequence mod (n + 1)).
Computational result: it looks like a(2*A367420(n) - 1) = -1, checked for n from [1, 2000].
The lower bound for nonnegative a(n) is n*(n + 1)/2.
Empirical observation: for a(n) = F_i, i = t*A001177(n + 1), t is from {1/3, 1/2, 2/3, 1, 3/2, 2}.

Examples

			For n = 3: (3 + 1)*(3 + 2*k)/2 = 6 + 4*k is a Fibonacci number at first for k = 7. Thus a(3) = 34.
For n = 7: (7 + 1)*(7 + 2*k)/2 = 28 + 8*k. (Fib_i congruent to 4 mod 8) has no solution because the Fibonacci sequence modulo 8 has a period of 12: (1, 1, 2, 3, 5, 0, 5, 5, 2, 7, 1, 0), the residues are {0, 1, 2, 3, 5, 7} and 4 is not among them. Thus a(7) = -1.
For n = 11: (11 + 1)*(11 + 2*k)/2 = 66 + 12*k . (Fib_i congruent to 6 mod 12) has no solution because the Fibonacci sequence modulo 12 has a period of 24: (1, 1, 2, 3, 5, 8, 1, 9, 10, 7, 5, 0, 5, 5, 10, 3, 1, 4, 5, 9, 2, 11, 1, 0), the residues are {0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11} and 6 is not among them. Thus a(11) = -1.
		

Crossrefs

Programs

  • PARI
    isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8));
    row(n) = {my(L=List([0]), X=Mod([1, 1; 1, 0], n), I=Mod([1, 0; 0, 1], n), M=X); while(M<>I, M*=X; listput(L, lift(M[2, 2]))); Vec(L);} \\ A161553
    a(n) = my(p=(n + 1)*(n + 2*k)/2, x=polcoef(p, 1, 'k), y = polcoef(p, 0, 'k), v=row(x)); if (!vecsearch(Set(v),y % x), return(-1)); my(j=0); while ((denominator(jj=((2*fibonacci(j) - n*(n+1))/(2*(n+1)))) != 1) || (numerator(jj)<0), j++); fibonacci(j); \\ Michel Marcus, Jul 19 2025

Extensions

Corrected and extended by Michel Marcus, Jul 19 2025

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)
    		)
    	)
    }
Showing 1-2 of 2 results.