login

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”).

A235602
a(n) = n/wt(n) if wt(n) divides n, otherwise a(n) = n, where wt(n) is the binary weight of n (A000120).
3
1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 6, 13, 14, 15, 16, 17, 9, 19, 10, 7, 22, 23, 12, 25, 26, 27, 28, 29, 30, 31, 32, 33, 17, 35, 18, 37, 38, 39, 20, 41, 14, 43, 44, 45, 46, 47, 24, 49, 50, 51, 52, 53, 54, 11, 56, 57, 58, 59, 15, 61, 62, 63, 64, 65, 33, 67, 34, 23, 70, 71, 36, 73, 74, 75, 76, 77, 78, 79, 40, 27, 82
OFFSET
1,2
MATHEMATICA
bw[n_]:=Module[{w=DigitCount[n, 2, 1]}, If[Divisible[n, w], n/w, n]]; Array[ bw, 90] (* Harvey P. Dale, Nov 06 2016 *)
PROG
(PARI) a(n) = my(s=hammingweight(n)); if (n % s, n, n/s); \\ Michel Marcus, Jul 15 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jan 18 2014
STATUS
approved