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

A199397 Binary XOR of 3^k as k varies from 0 to n.

Original entry on oeis.org

1, 2, 11, 16, 65, 178, 619, 2784, 4929, 24482, 47371, 133872, 659713, 1196754, 5945771, 8408000, 34643073, 94509378, 313886731, 1475558352, 2552700993, 12739900146, 24581737195, 70102639264, 350315469377, 639249412322, 3139708751627, 4623469310128, 18666316402561
Offset: 0

Views

Author

Paul D. Hanna, Nov 05 2011

Keywords

Comments

Appears to be a self-convolution of an integer sequence (true for at least the initial 761 terms).

Examples

			a(2) = 1 XOR 3 = 2; a(3) = 1 XOR 3 XOR 9 = 11; a(4) = 1 XOR 3 XOR 9 XOR 27 = 16.
		

Crossrefs

Cf. A199396.

Programs

  • Maple
    A[0]:= 1:
    for n from 1 to 40 do
      A[n]:= Bits:-Xor(A[n-1],3^n)
    od:
    seq(A[i],i=0..40); # Robert Israel, Nov 02 2015
  • Mathematica
    FoldList[BitXor, 3^Range[0, 28]] (* Vladimir Reshetnikov, Nov 02 2015 *)
  • PARI
    {a(n)=if(n<0,0,bitxor(a(n-1),3^n))}

A199403 Binary XOR of (2^k - (-1)^k)/3 as k varies from 1 to n.

Original entry on oeis.org

1, 0, 3, 6, 13, 24, 51, 102, 205, 408, 819, 1638, 3277, 6552, 13107, 26214, 52429, 104856, 209715, 419430, 838861, 1677720, 3355443, 6710886, 13421773, 26843544, 53687091, 107374182, 214748365, 429496728, 858993459, 1717986918, 3435973837, 6871947672, 13743895347
Offset: 1

Views

Author

Paul D. Hanna, Nov 05 2011

Keywords

Examples

			a(2) = (2^1+1)/3 XOR (2^2-1)/3 = 1 XOR 1 = 0;
a(3) = (2^1+1)/3 XOR (2^2-1)/3 XOR (2^3+1)/3 = 1 XOR 1 XOR 3 = 3;
a(4) = (2^1+1)/3 XOR (2^2-1)/3 XOR (2^3+1)/3 XOR (2^4-1)/3 = 1 XOR 1 XOR 3 XOR 5 = 6.
		

Crossrefs

Programs

  • Maple
    a:= n-> (<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>, <0|0|0|0|1>, <-2|1|0|0|2>>^n. <<0, 1, 0, 3, 6>>)[1, 1]: seq(a(n), n=1..60); # Alois P. Heinz, Nov 05 2011
  • Mathematica
    FoldList[BitXor, Table[(2^n - (-1)^n)/3, {n, 1, 20}]] (* Vladimir Reshetnikov, Nov 02 2015 *)
    Table[(6*Cos[Pi n/2] + 2*Sin[Pi n/2] + 4*2^n - 5*(-1)^n - 5)/10, {n, 1, 20}] (* Vladimir Reshetnikov, Nov 02 2015 *)
  • PARI
    {a(n)=if(n<0,0,bitxor(a(n-1),((2^n-(-1)^n)/3)))}
    
  • PARI
    Vec(x*(3*x^2-2*x+1)/((x-1)*(x+1)*(2*x-1)*(x^2+1)) + O(x^100)) \\ Colin Barker, Nov 02 2015

Formula

G.f.: (3*x^2-2*x+1)*x/(2*x^5-x^4-2*x+1). - Alois P. Heinz, Nov 05 2011
From Vladimir Reshetnikov, Nov 02 2015: (Start)
a(n) = (6*cos(Pi*n/2) + 2*sin(Pi*n/2) + 4*2^n - 5*(-1)^n - 5)/10.
Recurrence: a(1) = 1, a(2) = 0, a(3) = 3, a(4) = 6, a(5) = 13, a(n) = 2*a(n-1) + a(n-4) - 2*a(n-5).
E.g.f.: (2*cosh(2*x) - 5*cosh(x) + 2*sinh(2*x) + 3*cos(x) + sin(x))/5.
(End)
Showing 1-2 of 2 results.