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.

A140113 a(1)=1, a(n)=a(n-1)+n if n odd, a(n)=a(n-1)+ n^2 if n is even.

Original entry on oeis.org

1, 5, 8, 24, 29, 65, 72, 136, 145, 245, 256, 400, 413, 609, 624, 880, 897, 1221, 1240, 1640, 1661, 2145, 2168, 2744, 2769, 3445, 3472, 4256, 4285, 5185, 5216, 6240, 6273, 7429, 7464, 8760, 8797, 10241, 10280, 11880, 11921, 13685, 13728, 15664, 15709
Offset: 1

Views

Author

Artur Jasinski, May 08 2008

Keywords

Comments

One notices the powers 8, 256, 400, and 2744 (14^3) and wonders if the sum is ever again a power. [J. M. Bergot, Sep 07 2011]

Crossrefs

Cf. A136047.

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,If[EvenQ[n],a+n+1,a+(n+1)^2]}; Transpose[ NestList[ nxt,{1,1},50]][[2]] (* or *) LinearRecurrence[{1,3,-3,-3,3,1,-1},{1,5,8,24,29,65,72},50] (* Harvey P. Dale, Jul 22 2014 *)
    CoefficientList[Series[(- x^4 + 4 x^3 + 4 x + 1)/(x^7 - x^6 - 3 x^5 + 3 x^4 + 3 x^3 - 3 x^2 - x + 1), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 23 2014 *)
  • PARI
    print1(a=1);for(n=2,99,print1(", ",a+=n^(2-n%2))) \\ Charles R Greathouse IV, Jul 19 2011

Formula

O.g.f.: (-x^4 + 4*x^3 + 4*x + 1)/(x^7 - x^6 - 3*x^5 + 3*x^4 + 3*x^3 - 3*x^2 - x + 1). - Alexander R. Povolotsky, May 08 2008
a(2*n) = A185872(n,2); a(2*n-1) = A100178(n). - Franck Maminirina Ramaharo, Feb 26 2018