login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A184616 Negated negative parts of the nonadjacent forms 6

%I

%S 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 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 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 Negated negative parts of the nonadjacent forms

%C This sequence together with A184615 (positive parts) gives the (signed binary) nonadjacent form (NAF) of n, see fxtbook link and example in A184615.

%C No two adjacent bits in the binary representations of a(n) are 1.

%C No two adjacent bits in the binary representations of a(n)+A184615(n) are 1.

%H Rémy Sigrist, <a href="/A184616/b184616.txt">Table of n, a(n) for n = 0..8192</a>

%H Pages 61-62 of <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>.

%F A184615(n) - a(n) = n

%F a(n) + A184615(n) = A184617(n)

%e (see A184615)

%t bin2naf[x_] := Module[{xh, x3, c, np, nm},

%t xh = BitShiftRight[x, 1];

%t x3 = x + xh;

%t c = BitXor[xh, x3];

%t np = BitAnd[x3, c];

%t nm = BitAnd[xh, c];

%t Return[{np, nm}]];

%t a[n_] := bin2naf[n][[2]];

%t Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, May 30 2019, from PARI code in A184615 *)

%o (PARI) (see A184615)

%Y Cf. A184615 (positive parts), A184617 (sums of both parts =A184615+A184616).

%K nonn

%O 0,7

%A _Joerg Arndt_, Jan 18 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 12 00:34 EDT 2022. Contains 356067 sequences. (Running on oeis4.)