OFFSET
1,5
EXAMPLE
a(1) = (0 + 2 - 2*1) = 0;
a(2) = (0 + 2 - 2*1) + (1 + 3 - 2*2) = 0;
a(3) = (0 + 2 - 2*1) + (1 + 3 - 2*2) + (2 + 5 - 2*3) = 1;
a(4) = (0 + 2 - 2*1) + (1 + 3 - 2*2) + (2 + 5 - 2*3) + (3 + 5 - 2*4) = 1.
PROG
(PARI) isfib(k) = my(m=5*k^2); issquare(m-4) || issquare(m+4);
nextfib(n) = my(k=n+1); while (!isfib(k), k++); k;
prevfib(n) = my(k=n-1); while (!isfib(k), k--); k;
a(n) = sum(k=1, n, prevfib(k) + nextfib(k) - 2*k); \\ Michel Marcus, Apr 10 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Apr 09 2020
STATUS
approved