OFFSET
1,1
COMMENTS
FORMULA
PROG
(PARI) {a(n)=local(B); B=0; for(i=0, n-1, B=bitxor(B, binomial(n-1, i)%2* (16*2^valuation(n-i, 2)-2^(valuation(n-i, 2)%4)-8*(valuation(n-i, 2)\4)-8))); B}
(Python)
from operator import xor
from functools import reduce
def A101122(n): return reduce(xor, (((1<<(m:=(~(k+1)&k).bit_length()+4))-((m&-4)<<1)-(1<<(m&3)))&-int(not k&~(n-1)) for k in range(n))) # Chai Wah Wu, Jul 10 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Simon Plouffe and Paul D. Hanna, Dec 02 2004
STATUS
approved