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.

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

This page as a plain text file.
%I A140149 #17 May 27 2024 11:39:49
%S A140149 1,9,18,82,107,323,372,884,965,1965,2086,3814,3983,6727,6952,11048,
%T A140149 11337,17169,17530,25530,25971,36619,37148,50972,51597,69173,69902,
%U A140149 91854,92695,119695,120656,153424,154513,193817,195042,241698,243067
%N A140149 a(1)=1, a(n)=a(n-1)+n^2 if n odd, a(n)=a(n-1)+ n^3 if n is even.
%H A140149 Harvey P. Dale, <a href="/A140149/b140149.txt">Table of n, a(n) for n = 1..1000</a>
%H A140149 <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (1,4,-4,-6,6,4,-4,-1,1).
%F A140149 From _R. J. Mathar_, Feb 22 2009: (Start)
%F A140149 G.f.: x*(-1-8*x-5*x^2-32*x^3+5*x^4-8*x^5+x^6)/((1+x)^4*(x-1)^5).
%F A140149 a(n) = a(n-1)+4*a(n-2)-4*a(n-3)-6*a(n-4)+6*a(n-5)+4*a(n-6)-4*a(n-7)-a(n-8)+a(n-9). (End)
%t A140149 a = {}; r = 2; s = 3; 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*)
%t A140149 nxt[{n_,a_}]:={n+1,If[EvenQ[n],a+(n+1)^2,a+(n+1)^3]}; NestList[nxt,{1,1},40][[;;,2]] (* or *) LinearRecurrence[{1,4,-4,-6,6,4,-4,-1,1},{1,9,18,82,107,323,372,884,965},40] (* _Harvey P. Dale_, May 27 2024 *)
%Y A140149 Cf. A000027, A000217, A000330, A000537, A000538, A000539, A136047, A140113.
%K A140149 nonn
%O A140149 1,2
%A A140149 _Artur Jasinski_, May 12 2008