A159780 Inner product of the binary representation of n and its reverse.
0, 1, 0, 2, 0, 2, 1, 3, 0, 2, 0, 2, 0, 2, 2, 4, 0, 2, 0, 2, 1, 3, 1, 3, 0, 2, 2, 4, 1, 3, 3, 5, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 2, 4, 2, 4, 0, 2, 2, 4, 0, 2, 2, 4, 0, 2, 2, 4, 2, 4, 4, 6, 0, 2, 0, 2, 0, 2, 0, 2, 1, 3, 1, 3, 1, 3, 1, 3, 0, 2, 0, 2, 2, 4, 2, 4, 1, 3, 1, 3, 3, 5, 3, 5, 0, 2, 2, 4, 0, 2, 2, 4, 1
Offset: 0
Examples
14 is represented by the binary vector (1,1,1,0). The reverse is (0,1,1,1). The inner product is 1*0+1*1+1*1+0*1 = 2. Hence a(14) = 2.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Crossrefs
Cf. A216176.
Programs
-
Haskell
a159780 n = sum $ zipWith (*) bs $ reverse bs where bs = a030308_row n -- Reinhard Zumkeller, Mar 10 2013, Oct 21 2011
-
Mathematica
Table[d=IntegerDigits[n,2]; d.Reverse[d], {n,0,1023}]
Comments