OFFSET
1,3
LINKS
FORMULA
a(n) = -n iff n belongs to A001906.
EXAMPLE
PROG
(PARI) a(n) = { my (v=0, neg=0, pos=0, f); n=-n; for (e=0, oo, f=fibonacci(-1-e); if (f<0, neg+=f, pos+=f); if (neg <=n && n <= pos, while (n, if (f<0, neg-=f, pos-=f); if (neg > n || n > pos, v=f; n-=f; ); f=fibonacci(-1-e--); ); return (v); ); ); }
CROSSREFS
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Aug 06 2022
STATUS
approved