A349932 Product of n and its binary ones' complement.
0, 2, 0, 12, 10, 6, 0, 56, 54, 50, 44, 36, 26, 14, 0, 240, 238, 234, 228, 220, 210, 198, 184, 168, 150, 130, 108, 84, 58, 30, 0, 992, 990, 986, 980, 972, 962, 950, 936, 920, 902, 882, 860, 836, 810, 782, 752, 720, 686, 650, 612, 572, 530, 486, 440, 392, 342, 290
Offset: 1
Examples
For n = 9, a(9) = 0b1001 * 0b0110 = 9 * 6 = 54.
Crossrefs
Cf. A035327.
Programs
-
PARI
a(n) = n*bitneg(n, exponent(n)) \\ Andrew Howroyd, Dec 05 2021
-
Python
def a(n): return 0 if n == 0 else n * (n^((1 << n.bit_length()) - 1)) print([a(n) for n in range(1, 58)]) # Michael S. Branicky, Dec 05 2021
Formula
a(n) = n*A035327(n).
Comments