|
Search: id:A079471
|
|
|
| A079471 |
|
Fixed points of reversed binary words in reversed lexicographic order. |
|
+0 2
|
|
| 0, 1, 6, 10, 18, 34, 60, 66, 92, 108, 116, 130, 156, 172, 180, 204, 212, 228, 258, 284, 300, 308, 332, 340, 356, 396, 404, 420, 452, 514, 540, 556, 564, 588, 596, 612, 652, 660, 676, 708, 780, 788, 804, 836, 900, 1026, 1052, 1068, 1076, 1100, 1108, 1124
(list; graph; listen)
|
|
|
OFFSET
|
0,3
|
|
|
COMMENT
|
These are the words where the bit count is equal to zero or 2^i0 where i0 is the index of the lowest set bit.
|
|
LINKS
|
J. Arndt, Fxtbook, see Bit Wizardy chapter.
|
|
EXAMPLE
|
Zero is a fixed point: 0: ...........
The next few in decimal and binary form (dots for zeros), lowest (rightmost) bit has index zero are:
1: ............1
6: ..........11.
10: ........1.1.
18: .......1..1.
34: ......1...1.
60: ......1111..
66: .....1....1.
92: .....1.111..
108: ....11.11..
116: ....111.1..
130: ...1.....1.
|
|
PROGRAM
|
Generate the binary words lex order: start with zero and get successive elements via inline ulong prev_lexrev(ulong x) // Return previous word in (reversed) lex order. { ulong x0 = x & -x; if ( x & (x0<<1) ) x ^= x0; else { x0 ^= (x0<<1); x ^= x0; x |= 1; } return x; }
To extract the fixed points select those where the following function returns a nonzero value: ulong is_lexrev_fixed_point(ulong x) // Return whether x is a fixed point in the prev_lexrev() - sequence { if ( x & 1 ) { if ( 1==x ) return 1; else return 0; } else { ulong w = bit_count(x); if ( w != (w & -w) ) return 0; if ( 0==x ) return 1; return ( (x & -x) & w ); } }
|
|
CROSSREFS
|
Sequence in context: A116001 A111617 A032641 this_sequence A134351 A138828 A109312
Adjacent sequences: A079468 A079469 A079470 this_sequence A079472 A079473 A079474
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
Joerg Arndt (arndt(AT)jjj.de), Jan 15 2003
|
|
|
Search completed in 0.002 seconds
|