login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A138954 Number of complement symmetries in the rotations of the binary expansion of a number. 2
0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,11

COMMENTS

It seems that the number of complement rotational symmetries is nonzero iff #0 = #1 in the binary expansion of a number.

The above statement is true in only one direction. It is clearly necessary for the number of 1 bits to equal the number of 0 bits. However, this is not sufficient. The first counterexample is n = 37 with binary expansion 100101 and complement 011010. Values of n for which a(n) is nonzero are therefore a proper subset of A031443. - Andrew Howroyd, Jan 12 2020

LINKS

Andrew Howroyd, Table of n, a(n) for n = 0..1023

EXAMPLE

a(2) = 1 because 2 has binary expansion 10 and the complement shows up once in rotations;

a(10) = 2 because 10 has binary expansion 1010 and its complement shows up twice in rotations.

PROG

(PARI) a(n)={my(s=0); if(n, my(b=logint(n, 2)+1); if(2*hammingweight(n)==b, my(w=2^b-1-n); for(i=2, b, w=if(w%2, w+2^b, w)\2; if(w==n, s++)))); s} \\ Andrew Howroyd, Jan 12 2020

CROSSREFS

Cf. A031443, A138904.

Sequence in context: A306936 A027652 A127282 * A245811 A258822 A064530

Adjacent sequences:  A138951 A138952 A138953 * A138955 A138956 A138957

KEYWORD

easy,nonn

AUTHOR

Max Sills, Apr 03 2008

EXTENSIONS

Missing a(8) inserted and terms a(21) and beyond from Andrew Howroyd, Jan 12 2020

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 11 00:03 EDT 2021. Contains 342877 sequences. (Running on oeis4.)