This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A184616 #22 Feb 25 2023 04:27:54 %S A184616 0,0,0,1,0,0,2,1,0,0,0,5,4,4,2,1,0,0,0,1,0,0,10,9,8,8,8,5,4,4,2,1,0,0, %T A184616 0,1,0,0,2,1,0,0,0,21,20,20,18,17,16,16,16,17,16,16,10,9,8,8,8,5,4,4, %U A184616 2,1,0,0,0,1,0,0,2,1,0,0,0,5,4,4,2,1,0,0,0,1,0,0,42,41 %N A184616 Negated negative parts of the nonadjacent forms. %C A184616 This sequence together with A184615 (positive parts) gives the (signed binary) nonadjacent form (NAF) of n, see fxtbook link and example in A184615. %C A184616 No two adjacent bits in the binary representations of a(n) are 1. %C A184616 No two adjacent bits in the binary representations of a(n)+A184615(n) are 1. %H A184616 Rémy Sigrist, <a href="/A184616/b184616.txt">Table of n, a(n) for n = 0..8192</a> %H A184616 Pages 61-62 of <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>. %F A184616 A184615(n) - a(n) = n %F A184616 a(n) + A184615(n) = A184617(n) %e A184616 (see A184615) %t A184616 bin2naf[x_] := Module[{xh, x3, c, np, nm}, %t A184616 xh = BitShiftRight[x, 1]; %t A184616 x3 = x + xh; %t A184616 c = BitXor[xh, x3]; %t A184616 np = BitAnd[x3, c]; %t A184616 nm = BitAnd[xh, c]; %t A184616 Return[{np, nm}]]; %t A184616 a[n_] := bin2naf[n][[2]]; %t A184616 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, May 30 2019, from PARI code in A184615 *) %o A184616 (PARI) (see A184615) %Y A184616 Cf. A184615 (positive parts), A184617 (sums of both parts =A184615+A184616). %K A184616 nonn %O A184616 0,7 %A A184616 _Joerg Arndt_, Jan 18 2011