OFFSET
0,3
LINKS
FORMULA
a(a(n)) = a(n).
a(n) >= n.
PROG
(PARI) a(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r=vecsort(r); my (h=0, t=#r+1, v=0); for (k=1, #r, v=(v+k%2)*2^if (k%2, r[t--], r[h++])-k%2; ); return (v); }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Mar 13 2023
STATUS
approved