OFFSET
1,2
COMMENTS
A permutation of the positive integers.
This permutation satisfies a weak ordering: If b = a(c*d) and e = a(c) and f = a(d) then b > e and b > f with c,d > 1.
LINKS
FORMULA
a(2^n) = 2^(n+1) - 1.
abs(a(n)-n) < n.
PROG
(PARI) f(x) = x/hammingweight(x);
cmpb(x, y) = my(hx=f(x), hy=f(y)); if (hx != hy, return(sign(hx-hy))); return(sign(x-y));
lista(nn) = Vec(vecsort([1..2*nn], cmpb, 1), nn); \\ Michel Marcus, Nov 05 2022
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Thomas Scheuerle, Oct 31 2022
STATUS
approved