reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
X[a_, b_] := Module[{A, B, C, x},
A = Reverse@IntegerDigits[a, 2];
B = Reverse@IntegerDigits[b, 2];
C = Expand[
Sum[A[[i]]*x^(i-1), {i, 1, Length[A]}]*
Sum[B[[i]]*x^(i-1), {i, 1, Length[B]}]];
PolynomialMod[C, 2] /. x -> 2];
T[n_, k_] := Module[{x = BitXor[n-1, 2n-1], k0 = k},
For[i = 1, True, i++, If[n*i == X[x, i],
If[k0 == 1, Return[i], k0--]]]];
Table[T[n-k+1, k], {n, 1, 14}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jan 04 2022 *)
approved
editing
proposed
approved
editing
proposed
A000265(n) = (n/2^valuation(n, 2));
A006519(n) = (1<<valuation(n, 2));
A048720(b, c) = if(!b || !c, 0, if(!(b%2), A006519(b)*A048720(A000265(b), c), bitxor(c, 2*A048720((b-1)/2, c))));
\\ A048720 can be computed also as:
A115872(n) = v115872[n]; \\ (Slow, but does the job! ) - Antti Karttunen, May 08 2019