cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A159780 Inner product of the binary representation of n and its reverse.

This page as a plain text file.
%I A159780 #15 Mar 24 2017 00:47:51
%S A159780 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,
%T A159780 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,
%U A159780 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
%N A159780 Inner product of the binary representation of n and its reverse.
%C A159780 a(n) gives the number of 1's that coincide in the binary representation of n and its reverse. For the n in A140900, we have a(n)=0. The number k first appears at n=2^k-1.
%C A159780 Also central terms and right edge of the triangle in A173920: a(n)=A173920(2*n,n)=A173920(n,n). [From _Reinhard Zumkeller_, Mar 04 2010]
%C A159780 a(A000225(n)) = n and a(m) < n for m < A000225(n). [_Reinhard Zumkeller_, Oct 21 2011]
%C A159780 a(n) = sum(A030308(n,k)*A030308(n,A070939(n)-1-k): k = 0..A070939(n)-1). - _Reinhard Zumkeller_, Mar 10 2013
%H A159780 Reinhard Zumkeller, <a href="/A159780/b159780.txt">Table of n, a(n) for n = 0..10000</a>
%e A159780 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.
%t A159780 Table[d=IntegerDigits[n,2]; d.Reverse[d], {n,0,1023}]
%o A159780 (Haskell)
%o A159780 a159780 n = sum $ zipWith (*) bs $ reverse bs
%o A159780    where bs = a030308_row n
%o A159780 -- _Reinhard Zumkeller_, Mar 10 2013, Oct 21 2011
%Y A159780 Cf. A216176.
%K A159780 nonn,base
%O A159780 0,4
%A A159780 _T. D. Noe_, Apr 22 2009