login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A101122
XOR BINOMIAL transform of A101119.
4
7, 17, 0, 34, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 257, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
OFFSET
1,1
COMMENTS
Nonzero terms form A101121 and occur at positions 2^k for k >= 0. A101119 equals the nonzero differences of A006519 and A003484. See A099884 for the definition of the XOR BINOMIAL transform.
FORMULA
a(n) = SumXOR_{k=0..n} (C(n, k) mod 2)*A101119(k), where SumXOR is summation under XOR. A101119(n) = SumXOR_{k=0..n} (C(n, k) mod 2)*a(k). a(2^(n-1)) = A101121(n) for n >= 1 and a(k)=0 when k is not a power of 2.
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