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!)
A258087 Start with all terms set to 0. Then add n to the next n+2 terms for n=0,1,2,... . 4

%I #51 Sep 08 2022 08:46:12

%S 0,0,1,3,6,9,14,18,25,30,39,45,56,63,76,84,99,108,125,135,154,165,186,

%T 198,221,234,259,273,300,315,344,360,391,408,441,459,494,513,550,570,

%U 609,630,671,693,736,759,804,828,875,900,949,975,1026,1053,1106,1134

%N Start with all terms set to 0. Then add n to the next n+2 terms for n=0,1,2,... .

%H Reinhard Zumkeller, <a href="/A258087/b258087.txt">Table of n, a(n) for n = 0..10000</a>

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

%F a(n) = (6*n^2+2*n-11+(2*n-5)*(-1)^n)/16+0^n.

%F a(n) = Sum_{i=1..n-1} (3*i+2)/4+(2-i)*(-1)^i/4.

%F From _Robert Israel_, May 19 2015: (Start)

%F G.f.: x^2*(x^3-x^2-2*x-1)/((x+1)^2*(x-1)^3).

%F E.g.f.: 1 + exp(x)*(6*x^2+8*x-11)/16 - exp(-x)*(2*x+5)/16.

%F a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5) for n >= 6. (End)

%F From _Bruno Berselli_, May 20 2015: (Start)

%F a(n) = a(-n) for n odd, a(n) = a(-n)+n/2 otherwise.

%F a(n) = (floor(n/2)+1)*(floor(n/2)+2*floor((n-1)/2))/2 for n>0. Therefore, after 3, all terms of the sequence are composite. (End)

%F a(n) = Sum_{i=floor((n-1)/2)..n-1} i, for n>0. - _Wesley Ivan Hurt_, Apr 11 2016

%e n | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, ...

%e __________________________________________

%e 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...

%e + 0, 0

%e + 1, 1, 1

%e + 2, 2, 2, 2

%e + 3, 3, 3, 3, 3

%e + 4, 4, 4, 4, 4, 4

%e + 5, 5, 5, 5, 5, 5, 5

%e + 6, 6, 6, 6, 6, 6, 6, 6

%e + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7

%e + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8

%e + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9

%e + ...

%e __________________________________________

%e a(n)|0, 0, 1, 3, 6, 9,14,18,25,30,39, ...

%p A258087:=n->(6*n^2+2*n-11+(2*n-5)*(-1)^n)/16+0^n: seq(A258087(n), n=0..100);

%t Join[{0}, Table[(6 n^2 + 2 n - 11 + (2 n - 5) (-1)^n)/16, {n, 100}]]

%t Table[Total@ Range[Floor[(n - 1)/2], n - 1], {n, 55}] (* _Michael De Vlieger_, Apr 11 2016 *)

%o (Magma) [(6*n^2+2*n-11+(2*n-5)*(-1)^n)/16+0^n: n in [0..60]]; // _Vincenzo Librandi_, May 20 2015

%o (Sage) [(6*n^2+2*n-11+(2*n-5)*(-1)^n)/16+0^n for n in (0..60)] # _Bruno Berselli_, May 20 2015

%o (Haskell)

%o a258087 n = a258087_list !! n

%o a258087_list = f 0 [0] $

%o map (\i -> take (i + 1) (repeat 0) ++ replicate (i + 2) i) [0..] where

%o f i ys@(y:_) (xs:xss) = (ys !! i) :

%o f (i + 1) (zipWith (+) (ys ++ repeat 0) xs) xss

%o -- _Reinhard Zumkeller_, May 21 2015

%o (PARI) a(n) = if (n==0, 0, sum(k = (n-1)\2, n-1, k)); \\ _Michel Marcus_, Apr 11 2016

%o (PARI) x='x+O('x^99); concat([0, 0], Vec(x^2*(x^3-x^2-2*x-1)/((x+1)^2*(x-1)^3))) \\ _Altug Alkan_, Apr 11 2016

%Y Cf. A272058.

%K nonn,easy

%O 0,4

%A _Wesley Ivan Hurt_, May 19 2015

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 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)