OFFSET
1,2
COMMENTS
LINKS
FORMULA
a(n) = n iff n belongs to A001519.
EXAMPLE
PROG
(PARI) a(n) = { my (v=0, neg=0, pos=0, f); 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