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.

A140158 a(1)=1, a(n) = a(n-1) + n^4 if n odd, a(n) = a(n-1) + n^1 if n is even.

Original entry on oeis.org

1, 3, 84, 88, 713, 719, 3120, 3128, 9689, 9699, 24340, 24352, 52913, 52927, 103552, 103568, 187089, 187107, 317428, 317448, 511929, 511951, 791792, 791816, 1182441, 1182467, 1713908, 1713936, 2421217, 2421247, 3344768, 3344800, 4530721
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Magma
    [(1/120)*(15*(-1 +(-1)^n) + (28 + 60*(-1)^n)*n + 30*n^2 + 20*(1 - 3*(-1)^n)*n^3 + 30*(1 -(-1)^n)*n^4 + 12*n^5): n in [1..50]]; // G. C. Greubel, Jul 05 2018
  • Mathematica
    a = {}; r = 4; s = 1; 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 *)
    LinearRecurrence[{1,5,-5,-10,10,10,-10,-5,5,1,-1}, {1, 3, 84, 88, 713, 719, 3120, 3128, 9689, 9699, 24340}, 50] (* or *) Table[(1/120)*(15*(-1 +(-1)^n) + (28 + 60*(-1)^n)*n + 30*n^2 + 20*(1 - 3*(-1)^n)*n^3 + 30*(1 -(-1)^n)*n^4 + 12*n^5), {n,1,50}] (* G. C. Greubel, Jul 05 2018 *)
    nxt[{n_,a_}]:={n+1,If[EvenQ[n],a+(n+1)^4,a+n+1]}; NestList[nxt,{1,1},40][[;;,2]] (* Harvey P. Dale, Dec 28 2024 *)
  • PARI
    for(n=1,50, print1((1/120)*(15*(-1 +(-1)^n) + (28 + 60*(-1)^n)*n + 30*n^2 + 20*(1 - 3*(-1)^n)*n^3 + 30*(1 -(-1)^n)*n^4 + 12*n^5), ", ")) \\ G. C. Greubel, Jul 05 2018
    

Formula

G.f.: x*(1 + 2*x + 76*x^2 - 6*x^3 + 230*x^4 + 6*x^5 + 76*x^6 - 2*x^7 + x^8)/((1+x)^5*(x-1)^6). - R. J. Mathar, Feb 22 2009