[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A140113
a(1)=1, a(n)=a(n-1)+n if n odd, a(n)=a(n-1)+ n^2 if n is even.
29
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,2
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]
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
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 *)
PROG
(PARI) print1(a=1); for(n=2, 99, print1(", ", a+=n^(2-n%2))) \\ Charles R Greathouse IV, Jul 19 2011
CROSSREFS
Cf. A136047.
Sequence in context: A169701 A271008 A272577 * A357117 A368484 A346552
KEYWORD
nonn,easy
AUTHOR
Artur Jasinski, May 08 2008
STATUS
approved