login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A224924 Sum_{i=0..n} Sum_{j=0..n} (i AND j), where AND is the binary logical AND operator. 4
0, 1, 3, 12, 16, 33, 63, 112, 120, 153, 211, 300, 408, 553, 735, 960, 976, 1041, 1155, 1324, 1536, 1809, 2143, 2544, 2952, 3433, 3987, 4620, 5320, 6105, 6975, 7936, 7968, 8097, 8323, 8652, 9072, 9601, 10239, 10992, 11800, 12729, 13779, 14956, 16248, 17673, 19231, 20928 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

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

LINKS

Enrique Pérez Herrero, Table of n, a(n) for n = 0..1000

R. J. Cano, Additional information.

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,

(PARI) a(n)=sum(i=0, n, sum(j=0, n, bitand(i, j))); \\ R. J. Cano, Aug 21 2013

CROSSREFS

Cf. A004125, A222423, A224915, A224923, A000217.

Sequence in context: A064106 A022411 A115229 * A136047 A082965 A045549

Adjacent sequences:  A224921 A224922 A224923 * A224925 A224926 A224927

KEYWORD

nonn,base

AUTHOR

Alex Ratushnyak, Apr 19 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 14 18:28 EDT 2019. Contains 328022 sequences. (Running on oeis4.)