login
A352783
Inverse permutation to A352782.
2
0, 1, 2, 5, 3, 9, 10, 21, 4, 13, 18, 37, 11, 41, 42, 85, 6, 17, 26, 53, 19, 73, 74, 149, 20, 45, 82, 165, 43, 169, 170, 341, 7, 25, 34, 69, 27, 105, 106, 213, 36, 77, 146, 293, 75, 297, 298, 597, 22, 81, 90, 181, 83, 329, 330, 661, 84, 173, 338, 677, 171, 681
OFFSET
0,3
FORMULA
A069010(a(n)) = A000120(n).
a(2^k) = A023758(k+1) for any k >= 0.
EXAMPLE
A352782(42) = 14, so a(14) = 42.
PROG
(PARI) a(n) = { my (v=0, s=1, e, oz, o); while (n, n\=2^e=1+valuation(n, 2); oz = (sqrtint(e*8)+1)\2; o = e-binomial((sqrtint(8*e)+1)\2, 2); v += s * (2^o-1) * 2^(oz-o); s *= 2^(1+oz)); v }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 02 2022
STATUS
approved