login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 2

%I #14 Jan 02 2024 09:02:01

%S 1,3,84,88,713,719,3120,3128,9689,9699,24340,24352,52913,52927,103552,

%T 103568,187089,187107,317428,317448,511929,511951,791792,791816,

%U 1182441,1182467,1713908,1713936,2421217,2421247,3344768,3344800,4530721

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

%H G. C. Greubel, <a href="/A140158/b140158.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_11">Index entries for linear recurrences with constant coefficients</a>, signature (1,5,-5,-10,10,10,-10,-5,5,1,-1).

%F 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

%t 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_ *)

%t 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 *)

%o (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

%o (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

%Y Cf. A000027, A000217, A000330, A000537, A000538, A000539, A136047, A140113.

%K nonn

%O 1,2

%A _Artur Jasinski_, May 12 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)