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-3 of 3 results.

A182536 a(0)=0, a(1)=1, a(n)=(a(n-1) XOR a(n-2)) + n.

Original entry on oeis.org

0, 1, 3, 5, 10, 20, 36, 55, 27, 53, 56, 24, 44, 65, 123, 73, 66, 28, 112, 127, 35, 113, 104, 48, 112, 89, 67, 53, 146, 196, 116, 207, 219, 53, 272, 328, 124, 345, 331, 57, 410, 460, 128, 375, 547, 897, 464, 640, 896, 305, 739, 1029, 1818, 852, 1156, 2055, 3259, 1269, 2184, 3256, 1132, 2321, 3515, 1257, 2450, 3516, 1136, 2575
Offset: 0

Views

Author

Alex Ratushnyak, May 04 2012

Keywords

Crossrefs

Programs

  • Python
    prpr, prev = 0,1
    for n in range(2,99):
        current = (prpr ^ prev) + n
        print(prpr, end=', ')
        prpr, prev = prev, current

Formula

a(0)=0, a(1)=1, a(n)=(a(n-1) XOR a(n-2)) + n, where XOR is the bitwise exclusive-or operator.

A182537 a(0)=0, a(1)=1, a(n) = a(n-1) + (a(n-2) XOR n).

Original entry on oeis.org

0, 1, 3, 5, 12, 12, 22, 33, 63, 103, 156, 264, 408, 669, 1075, 1733, 2792, 4540, 7350, 11877, 19207, 31095, 50312, 81384, 131704, 213097, 344779, 557885, 902676, 1460532, 2363198, 3823721, 6186887, 10010575, 16197492, 26208096, 42405552, 68613621, 111019147, 179632733
Offset: 0

Views

Author

Alex Ratushnyak, May 04 2012

Keywords

Crossrefs

Programs

  • Mathematica
    nxt[{n_,a_,b_}]:={n+1,b,b+BitXor[a,n+1]}; NestList[nxt,{1,0,1},40][[All,2]] (* Harvey P. Dale, Jul 02 2021 *)
  • 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) XOR n), where XOR is the bitwise exclusive-or operator.

A182510 a(0)=0, a(1)=1, a(n)=(a(n-1) XOR n) - a(n-2).

Original entry on oeis.org

0, 1, 3, -1, -8, -2, 0, 9, 1, -1, -12, 0, 24, 21, 3, -9, -28, -2, 8, 29, 1, -9, -32, 0, 56, 33, 3, -9, -24, -2, -8, -23, -47, 7, 84, 112, 0, -75, -109, -1, 68, 110, 0, -67, -111, -1, 64, 112, 0, -63, -13, -1, -40, -18, 0, 73, 113, -1, -172, -144, -8, 85, 115
Offset: 0

Views

Author

Alex Ratushnyak, May 03 2012

Keywords

Comments

Conjectures: the sequence contains 8 zeros, and more positive terms than negative.

Crossrefs

Cf. A182509.

Programs

  • PARI
    v=vector(100);v[1]=0;v[2]=1;for(i=3,#v,v[i]=bitxor(v[i-1],i-1)-v[i-2]); v \\ Charles R Greathouse IV, May 03 2012
  • Python
    prpr = 0
    prev = 1
    for n in range(2,99):
      current = (prev ^ n) - prpr
      print(prpr, end=' ')
      prpr = prev
      prev = current
    

Formula

a(0)=0, a(1)=1, a(n)=(a(n-1) XOR n) - a(n-2), where XOR is the bitwise exclusive-or operator.
Showing 1-3 of 3 results.