OFFSET
1,1
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
MATHEMATICA
Table[2^(IntegerExponent[16*n, 2]) - 8*Floor[IntegerExponent[16*n, 2]/4] - 2^(Mod[IntegerExponent[16*n, 2], 4]), {n, 1, 50}] (* G. C. Greubel, Nov 01 2018 *)
PROG
(PARI) {a(n)=2^valuation(16*n, 2)-(8*(valuation(16*n, 2)\4)+2^(valuation(16*n, 2)%4))}
(Magma) [2^Valuation(16*n, 2) - 8*Floor(Valuation(16*n, 2)/4) - 2^(Valuation(16*n, 2) mod 4): n in [1..50]]; // G. C. Greubel, Nov 01 2018
(Python)
def A101119(n): return (1<<(m:=(~n&n-1).bit_length()+4))-((m&-4)<<1)-(1<<(m&3)) # Chai Wah Wu, Jul 10 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Simon Plouffe and Paul D. Hanna, Dec 02 2004
STATUS
approved