%I #38 Nov 03 2022 08:20:01
%S 0,1,3,12,16,33,63,112,120,153,211,300,408,553,735,960,976,1041,1155,
%T 1324,1536,1809,2143,2544,2952,3433,3987,4620,5320,6105,6975,7936,
%U 7968,8097,8323,8652,9072,9601,10239,10992,11800,12729,13779,14956,16248,17673,19231,20928
%N Sum_{i=0..n} Sum_{j=0..n} (i AND j), where AND is the binary logical AND operator.
%C For n>0, a(2^n)-A000217(2^n)=a(2^n-1)-A000217(2^n-1) [See links]. - _R. J. Cano_, Aug 21 2013
%H Enrique Pérez Herrero, <a href="/A224924/b224924.txt">Table of n, a(n) for n = 0..1000</a>
%H R. J. Cano, <a href="/w/images/6/68/PropertiesA224924andA2000217.pdf">Additional information</a>
%H Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, <a href="https://arxiv.org/abs/2210.10968">Identities and periodic oscillations of divide-and-conquer recurrences splitting at half</a>, arXiv:2210.10968 [cs.DS], 2022, pp. 42-43.
%F a(2^n) = a(2^n - 1) + 2^n.
%F a(n) -a(n-1) = 2*A222423(n) -n. - _R. J. Mathar_, Aug 22 2013
%p read("transforms") :
%p A224924 := proc(n)
%p local a,i,j ;
%p a := 0 ;
%p for i from 0 to n do
%p for j from 0 to n do
%p a := a+ANDnos(i,j) ;
%p end do:
%p end do:
%p a ;
%p end proc: # _R. J. Mathar_, Aug 22 2013
%t a[n_] := Sum[BitAnd[i, j], {i, 0, n}, {j, 0, n}];
%t Table[a[n], {n, 0, 20}]
%t (* _Enrique Pérez Herrero_, May 30 2015 *)
%o (Python)
%o for n in range(99):
%o s = 0
%o for i in range(n+1):
%o for j in range(n+1):
%o s += i & j
%o print(s, end=',')
%o (PARI) a(n)=sum(i=0,n,sum(j=0,n,bitand(i,j))); \\ _R. J. Cano_, Aug 21 2013
%Y Cf. A004125, A222423, A224915, A224923, A000217.
%K nonn,base
%O 0,3
%A _Alex Ratushnyak_, Apr 19 2013