OFFSET
0,3
COMMENTS
LINKS
Enrique Pérez Herrero, Table of n, a(n) for n = 0..1000
R. J. Cano, Additional information
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, pp. 42-43.
FORMULA
a(2^n) = a(2^n - 1) + 2^n.
a(n) -a(n-1) = 2*A222423(n) -n. - R. J. Mathar, Aug 22 2013
MAPLE
read("transforms") :
A224924 := proc(n)
local a, i, j ;
a := 0 ;
for i from 0 to n do
for j from 0 to n do
a := a+ANDnos(i, j) ;
end do:
end do:
a ;
end proc: # R. J. Mathar, Aug 22 2013
MATHEMATICA
a[n_] := Sum[BitAnd[i, j], {i, 0, n}, {j, 0, n}];
Table[a[n], {n, 0, 20}]
(* Enrique Pérez Herrero, May 30 2015 *)
PROG
(Python)
for n in range(99):
s = 0
for i in range(n+1):
for j in range(n+1):
s += i & j
print(s, end=', ')
(PARI) a(n)=sum(i=0, n, sum(j=0, n, bitand(i, j))); \\ R. J. Cano, Aug 21 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Apr 19 2013
STATUS
approved