Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #18 Feb 18 2024 01:26:01
%S 0,1,6,10,18,34,60,66,92,108,116,130,156,172,180,204,212,228,258,284,
%T 300,308,332,340,356,396,404,420,452,514,540,556,564,588,596,612,652,
%U 660,676,708,780,788,804,836,900,1026,1052,1068,1076,1100,1108,1124
%N Fixed points of reversed binary words in reversed lexicographic order.
%C These are 0 and the words where the bit count is 2^i where i is the index of the lowest set bit.
%H Paolo Xausa, <a href="/A079471/b079471.txt">Table of n, a(n) for n = 0..10000</a>
%H Joerg Arndt, <a href="http://www.jjj.de/fxt/fxtpage.html#fxtbook">Fxtbook</a>, section 1.26.4 "The sequence of fixed points", p.73-74
%e Zero is a fixed point: 0: ...........
%e The next few in decimal and binary form (dots for zeros), lowest (rightmost) bit has index zero are:
%e 1: ............1
%e 6: ..........11.
%e 10: ........1.1.
%e 18: .......1..1.
%e 34: ......1...1.
%e 60: ......1111..
%e 66: .....1....1.
%e 92: .....1.111..
%e 108: ....11.11..
%e 116: ....111.1..
%e 130: ...1.....1.
%t Join[{0},Select[Range[10^4],DigitCount[#,2,1]==2^IntegerExponent[#,2]&]] (* _Paolo Xausa_, Nov 13 2023 *)
%o (C++)
%o /* Generate the binary words lex order:
%o start with zero and get successive elements via */
%o inline ulong prev_lexrev(ulong x)
%o /* Return previous word in (reversed) lex order. */
%o {
%o ulong x0 = x & -x;
%o if ( x & (x0<<1) ) x ^= x0;
%o else { x0 ^= (x0<<1); x ^= x0; x |= 1; }
%o return x;
%o }
%o /* To extract the fixed points, select those where
%o the following function returns a nonzero value: */
%o ulong is_lexrev_fixed_point(ulong x)
%o /* Return whether x is a fixed point in the prev_lexrev() - sequence */
%o {
%o if ( x & 1 ) { if ( 1==x ) return 1; else return 0; }
%o else
%o {
%o ulong w = bit_count(x);
%o if ( w != (w & -w) ) return 0;
%o if ( 0==x ) return 1; return ( (x & -x) & w );
%o }
%o }
%K easy,nonn
%O 0,3
%A _Joerg Arndt_, Jan 15 2003