%I #9 Aug 07 2022 15:37:05
%S 1,2,1,-1,5,1,2,1,-1,-3,1,-1,13,1,2,1,-1,5,1,2,1,-1,-3,1,-1,-8,1,2,1,
%T -1,-3,1,-1,34,1,2,1,-1,5,1,2,1,-1,-3,1,-1,13,1,2,1,-1,5,1,2,1,-1,-3,
%U 1,-1,-8,1,2,1,-1,-3,1,-1,-21,1,2,1,-1,5,1,2,1,-1
%N a(n) is the smallest term (in absolute value) in the negaFibonacci representation of n.
%C See A139764 and A356400 for similar sequences.
%C For n > 1, the greatest term in the negaFibonacci representation of n is A280511(n-1).
%H Rémy Sigrist, <a href="/A356399/b356399.txt">Table of n, a(n) for n = 1..10946</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/NegaFibonacci_coding">NegaFibonacci coding</a>
%H <a href="/index/Z#Zeckendorf">Index entries for sequences related to Zeckendorf expansion of n</a>
%F a(n) = n iff n belongs to A001519.
%e For n = 11:
%e - using F(-k) = A039834(k):
%e - 11 = F(-1) + F(-4) + F(-7),
%e - so a(11) = F(-1) = 1.
%o (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););); }
%Y Cf. A001519, A039834, A139764, A280511, A356400.
%K sign,base
%O 1,2
%A _Rémy Sigrist_, Aug 06 2022