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!)
A184617 With nonadjacent forms: A184615(n) + A184616(n). 4

%I #33 Sep 04 2021 13:28:04

%S 0,1,2,5,4,5,10,9,8,9,10,21,20,21,18,17,16,17,18,21,20,21,42,41,40,41,

%T 42,37,36,37,34,33,32,33,34,37,36,37,42,41,40,41,42,85,84,85,82,81,80,

%U 81,82,85,84,85,74,73,72,73,74,69,68,69,66,65,64,65,66,69,68,69,74,73,72,73,74,85,84,85,82,81,80,81,82

%N With nonadjacent forms: A184615(n) + A184616(n).

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

%C The value 0 appears once, otherwise, if the binary representation of a(n) has k set bits then it appears 2^(k-1) times.

%H Alois P. Heinz, <a href="/A184617/b184617.txt">Table of n, a(n) for n = 0..10922</a>

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

%F a(n) = A184615(n) + A184616(n).

%F a(n) = A178729(n)/2 = (n XOR n*3)/2. Note a(2^n) = 2^n. - _Alex Ratushnyak_, Aug 13 2012

%e See A184615.

%t a[n_] := Module[{nh, n3, c}, nh = BitShiftRight[n]; n3 = n + nh; c = BitXor[nh, n3]; BitAnd[n3, c] + BitAnd[nh, c]];

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

%o (PARI) (see A184615)

%o (Python)

%o for n in range(77):

%o print((n^(n*3))/2, end=',')

%o # _Alex Ratushnyak_, Aug 13 2012

%Y Cf. A178729.

%Y Cf. A184615 (positive parts), A184616 (negated negative parts).

%K nonn,look

%O 0,3

%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 April 24 08:59 EDT 2024. Contains 371935 sequences. (Running on oeis4.)