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.

A140156 a(1)=1, a(n) = a(n-1) + n^3 if n odd, a(n) = a(n-1) + n^5 if n is even.

Original entry on oeis.org

1, 33, 60, 1084, 1209, 8985, 9328, 42096, 42825, 142825, 144156, 392988, 395185, 933009, 936384, 1984960, 1989873, 3879441, 3886300, 7086300, 7095561, 12249193, 12261360, 20223984, 20239609, 32120985, 32140668, 49351036, 49375425
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Magma
    [(1/48)*(9*(-1 +(-1)^n) + 4*(1 -12(-1)^n)*n^2 + 12*(1 -(-1)^n)*n^3 + (16 + 30*(-1)^n)*n^4 + 12*(1 +(-1)^n)*n^5 + 4*n^6): n in [1..50]]; // G. C. Greubel, Jul 05 2018
  • Mathematica
    a = {}; r = 3; s = 5; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (* Artur Jasinski *)
    nxt[{n_,a_}]:={n+1,If[EvenQ[n],a+(n+1)^3,a+(n+1)^5]}; Transpose[ NestList[ nxt,{1,1},30]][[2]] (* or *) LinearRecurrence[ {1,6,-6,-15, 15,20,-20,-15,15,6,-6,-1,1},{1,33,60,1084,1209,8985,9328, 42096, 42825, 142825,144156, 392988,395185},40] (* Harvey P. Dale, Aug 27 2013 *)
    Table[(1/48)*(9*(-1 +(-1)^n) + 4*(1 -12(-1)^n)*n^2 + 12*(1 -(-1)^n)*n^3 + (16 + 30*(-1)^n)*n^4 + 12*(1 +(-1)^n)*n^5 + 4*n^6), {n, 1, 50}] (* G. C. Greubel, Jul 05 2018 *)
  • PARI
    for(n=1, 50, print1((1/48)*(9*(-1 +(-1)^n) + 4*(1 -12(-1)^n)*n^2 + 12*(1 -(-1)^n)*n^3 + (16 + 30*(-1)^n)*n^4 + 12*(1 +(-1)^n)*n^5 + 4*n^6), ", ")) \\ G. C. Greubel, Jul 05 2018
    

Formula

G.f.: -x*(1 + 32*x + 21*x^2 + 832*x^3 - 22*x^4 + 2112*x^5 - 22*x^6 + 832*x^7 + 21*x^8 + 32*x^9 + x^10)/((1+x)^6*(x-1)^7). - R. J. Mathar, Feb 22 2009