login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A243109 a(n) is the largest number smaller than n and having the same Hamming weight as n, or n if no such number exist. 2
0, 1, 1, 3, 2, 3, 5, 7, 4, 6, 9, 7, 10, 11, 13, 15, 8, 12, 17, 14, 18, 19, 21, 15, 20, 22, 25, 23, 26, 27, 29, 31, 16, 24, 33, 28, 34, 35, 37, 30, 36, 38, 41, 39, 42, 43, 45, 31, 40, 44, 49, 46, 50, 51, 53, 47, 52, 54, 57, 55, 58, 59, 61, 63, 32, 48, 65, 56, 66, 67, 69 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

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

PROG

(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

CROSSREFS

Cf. A241816.

Sequence in context: A247829 A246592 A241816 * A206012 A211940 A230664

Adjacent sequences:  A243106 A243107 A243108 * A243110 A243111 A243112

KEYWORD

nonn,base

AUTHOR

Philippe Beaudoin, Aug 20 2014

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 November 13 04:20 EST 2019. Contains 329085 sequences. (Running on oeis4.)