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.

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