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.

A213786 a(n) = Sum_{1<=i b(i)*b(j), where b(k) = A020985(k).

This page as a plain text file.
%I A213786 #21 Feb 12 2023 11:24:25
%S A213786 0,0,1,-1,0,2,-1,1,4,8,13,7,2,-2,1,-3,0,4,9,3,8,14,7,13,6,0,-5,-1,4,
%T A213786 10,3,9,16,24,33,23,32,42,31,41,52,64,77,63,50,38,49,37,26,16,7,15,6,
%U A213786 -2,5,-3,4,12,21,11,2,-6,1,-7,0,8,17,7,16,26,15,25,36
%N A213786 a(n) = Sum_{1<=i<j<=n} b(i)*b(j), where b(k) = A020985(k).
%C A213786 Suggested by A190173.
%H A213786 Alois P. Heinz, <a href="/A213786/b213786.txt">Table of n, a(n) for n = 0..10000</a>
%p A213786 b:= proc(n) option remember; local r;
%p A213786       `if`(n=0, 1, `if`(irem(n, 2, 'r')=0, b(r), b(r)*(-1)^r))
%p A213786     end:
%p A213786 s:= proc(j) option remember; `if`(j<2, 0, s(j-1)+b(j-1)) end:
%p A213786 a:= proc(n) option remember; `if`(n<2, 0, a(n-1)+b(n)*s(n)) end:
%p A213786 seq(a(n), n=0..100);  # _Alois P. Heinz_, Jun 23 2012
%t A213786 b[0] = 1; b[1] = 1; b[n_?EvenQ] := b[n] = b[n/2]; b[n_?OddQ] := b[n] = (-1)^((n-1)/2)*b[(n-1)/2]; a[n_] := Sum[b[i]*b[j], {i, 1, n-1}, {j, i+1, n}]; Table[a[n], {n, 0, 72}] (* _Jean-François Alcover_, Nov 27 2014 *)
%o A213786 (Python)
%o A213786 def A213786(n): return sum((-1 if (i&(i>>1)).bit_count()&1 else 1)*sum(-1 if (j&(j>>1)).bit_count()&1 else 1 for j in range(i+1,n+1)) for i in range(1,n+1)) # _Chai Wah Wu_, Feb 12 2023
%Y A213786 Cf. A020985, A190173.
%K A213786 sign
%O A213786 0,6
%A A213786 _N. J. A. Sloane_, Jun 20 2012