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.

Showing 1-1 of 1 results.

A182539 a(n) = a(n-1) + (a(n-2) AND n).

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 4, 6, 6, 6, 8, 10, 18, 26, 28, 38, 54, 54, 72, 90, 90, 106, 124, 126, 150, 174, 192, 202, 202, 210, 220, 238, 238, 270, 304, 306, 338, 370, 372, 406, 438, 438, 472, 506, 514, 554, 556, 598, 630, 646, 696, 698, 746, 794, 828, 846, 902, 910, 912, 922, 938, 962, 1004, 1006, 1070
Offset: 0

Views

Author

Alex Ratushnyak, May 04 2012

Keywords

Crossrefs

Cf. A182537.

Programs

  • Mathematica
    RecurrenceTable[{a[0]==0,a[1]==1,a[n]==a[n-1]+BitAnd[a[n-2],n]},a,{n,70}] (* Harvey P. Dale, Jan 23 2013 *)
  • Python
    prpr, prev = 0,1
    for n in range(2,99):
       current = prev + (prpr & n)
       print(prpr, end=' ')
       prpr, prev = prev, current

Formula

a(0)=0, a(1)=1, a(n) = a(n-1) + (a(n-2) AND n), where AND is the bitwise AND operator.
Showing 1-1 of 1 results.