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.

A131118 a(4n) = -n^2, a(4n+1) = n^2, a(4n+2) = 1-n^2, a(4n+3) = n*(n+1).

Original entry on oeis.org

0, 0, 1, 0, -1, 1, 0, 2, -4, 4, -3, 6, -9, 9, -8, 12, -16, 16, -15, 20, -25, 25, -24, 30, -36, 36, -35, 42, -49, 49, -48, 56, -64, 64, -63, 72, -81, 81, -80, 90, -100, 100, -99, 110, -121, 121, -120, 132, -144, 144, -143, 156, -169, 169, -168
Offset: 0

Views

Author

Paul Curtz, Sep 24 2007

Keywords

Comments

Up to signs, the first differences are in A131804. - R. J. Mathar, Mar 17 2009

Programs

  • GAP
    List([0..60], n-> ((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^Binomial(n+1,2) +5)/32 ); # G. C. Greubel, Nov 18 2019
  • Magma
    [((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^Binomial(n+1,2) +5)/32: n in [0..60]]; // G. C. Greubel, Nov 18 2019
    
  • Maple
    seq(((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^binomial(n+1,2) +5)/32, n=0..60); # G. C. Greubel, Nov 18 2019
  • Mathematica
    Table[((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^Binomial[n+1,2] +5)/32, {n,0,60}] (* G. C. Greubel, Nov 18 2019 *)
  • PARI
    a(n) = ((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^binomial(n+1,2) +5)/32; \\ G. C. Greubel, Nov 18 2019
    
  • Sage
    [((7+4*n-2*n^2)*(-1)^n -2*((n+4)+(n+2)*(-1)^n)*(-1)^binomial(n+1,2) +5)/32 for n in (0..60)] # G. C. Greubel, Nov 18 2019
    

Formula

From R. J. Mathar, Mar 17 2009: (Start)
a(n) = -2*a(n-1) -2*a(n-2) -2*a(n-3) +2*a(n-5) +2*a(n-6) +2*a(n-7) +a(n-8).
G.f.: x^2*(1+x^2+x^3+2*x)/((1-x)*(1+x^2)^2*(1+x)^3). (End)
a(n) = ((-2*n^2+4*n+7)*(-1)^n - 2*((n+4)+(n+2)*(-1)^n)*i^(n*(n+1))+5)/32, where i=sqrt(-1). - Bruno Berselli, Mar 27 2012

Extensions

More terms from Sean A. Irvine, Mar 13 2011