OFFSET
1,1
COMMENTS
LINKS
Jianing Song, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Negabinary.
Eric Weisstein's World of Mathematics, Negadecimal.
Wikipedia, Negative base.
FORMULA
a(n) == -n (mod 3).
EXAMPLE
MATHEMATICA
b[n_] := b[n] = b[Quotient[n - 1, -2]] + Mod[n, 2]; b[0] = 0; a[n_] := b[-n]; Array[a, 100] (* Amiram Eldar, Jul 23 2023 *)
PROG
(PARI) b(n) = if(n==0, 0, b(n\(-2))+n%2)
a(n) = b(-n)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jianing Song, Oct 18 2018
STATUS
approved