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

A272215
a(n) = that number formed by permuting the digits of n which is divisible by the highest power of 2 (in case of a tie, choose the smallest number).
3
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 22, 32, 24, 52, 26, 72, 28, 92, 30, 13, 32, 33, 34, 35, 36, 37, 38, 39, 40, 14, 24, 34, 44, 54, 64, 74, 48, 94, 50, 15, 52, 35, 54, 55, 56, 57, 58, 59, 60, 16, 26, 36, 64, 56, 66, 76, 68, 96, 70, 17, 72, 37, 74, 57, 76, 77, 78, 79, 80, 18, 28, 38
OFFSET
1,2
COMMENTS
There is no reason to allow permutations that begin with 0, because we can always gain a power of 2 by putting that zero at the other end. - N. J. A. Sloane, Apr 23 2016
LINKS
EXAMPLE
The numbers obtained by permuting the digits of 1336 are 1336, 1363, 1633, 3136, 3163, 6133, 3316, 3613, 6313, 3361, 3631 and 6331. The highest power of 2 dividing any of these is 2^6, which divides just one of them, 3136, so a(1336) = 3136.
MATHEMATICA
hp2[n_]:=Module[{c={#, IntegerExponent[#, 2]}&/@(FromDigits/@ Permutations[ IntegerDigits[ n]]), mx}, mx=Max[c[[All, 2]]]; Min[Select[c, #[[2]]==mx&][[All, 1]]]]; Array[hp2, 90] (* Harvey P. Dale, Jan 27 2020 *)
CROSSREFS
Sequence in context: A348287 A328447 A107602 * A323366 A030066 A355479
KEYWORD
nonn,base,look
AUTHOR
David A. Corneth, Apr 22 2016
STATUS
approved