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.
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
Keywords
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.
Links
- Michel Marcus, Table of n, a(n) for n = 0..3643
- Ctibor O. Zizka, Ratio of i/Z(n+1) vs. n for n = 1 to 500. Z(n+1) = A001177(n+1)
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
Comments