0,4

Philippe Beaudoin, Table of n, a(n) for n = 0..10000

(PARI) a(n) = {hn = hammingweight(n); forstep(k=n-1, 1, -1, if (hammingweight(k) == hn, return (k)); ); return (n); } \\ Michel Marcus, Aug 20 2014

Cf. A241816.

Sequence in context: A247829 A246592 A241816 * A206012 A211940 A230664

Adjacent sequences: A243106 A243107 A243108 * A243110 A243111 A243112

nonn,base

Philippe Beaudoin, Aug 20 2014

approved