OFFSET
1,2
FORMULA
EXAMPLE
a(3,5): 5 = 101_2 -> (3)0(3) = (11)0(11)_2 = 11011_2 = 27.
a(5,3): 3 = 11_2 -> (5)(5) = (101)(101)_2 = 101101_2 = 45.
PROG
(PARI) T(n, k) = my(bk=binary(k), sn=Str(fromdigits(binary(n))), s=""); for (i=1, #bk, if (bk[i] == 1, s=concat(s, sn), s=concat(s, "0"))); fromdigits(apply(eval, Vec(s)), 2); \\ Michel Marcus, Feb 11 2023
CROSSREFS
KEYWORD
AUTHOR
Marc LeBrun, Oct 18 2001
STATUS
approved