login
A180046
a(n+1) = a(n-3) + a(n-2) - a(n-1) + a(n).
1
1, 2, 3, 4, 4, 5, 8, 11, 12, 14, 21, 30, 35, 40, 56, 81, 100, 115, 152, 218, 281, 330, 419, 588, 780, 941, 1168, 1595, 2148, 2662, 3277, 4358, 5891, 7472, 9216, 11993, 16140, 20835, 25904, 33202, 44273, 57810, 72643, 92308, 121748, 159893, 203096, 257259
OFFSET
1,2
FORMULA
G.f. -x*(1+x)*(2*x^2+1)/(-1+x-x^2+x^3+x^4). - R. J. Mathar, Aug 14 2010
a(n) = (-1)^(n)*(A100329(n-1)-A100329(n)-2*A100329(n-2)+2*A100329(n-3)) with A100329(-1) = A100329(-2) = 0. - Johannes W. Meijer, Jul 06 2011
EXAMPLE
1 2 3 4 (by definition); 1 + 2 - 3 + 4 = 4, 2 + 3 - 4 + 4 = 5, 3 + 4 - 4 + 5 = 8.
MATHEMATICA
LinearRecurrence[{1, -1, 1, 1}, {1, 2, 3, 4}, 50] (* Harvey P. Dale, Mar 18 2015 *)
PROG
(PARI) Vec(x*(1+x)*(2*x^2+1)/(1-x+x^2-x^3-x^4)+O(x^99)) \\ Charles R Greathouse IV, Jul 06 2011
(Haskell)
import Data.List (zipWith4)
a180046 n = a180046_list !! (n-1)
a180046_list = [1..4] ++ zipWith4 (((((+) .) . (+)) .) . (-))
(drop 3 a180046_list) (drop 2 a180046_list)
(tail a180046_list) a180046_list
-- Reinhard Zumkeller, Oct 08 2014
CROSSREFS
Sequence in context: A103750 A036805 A036804 * A008329 A064558 A178031
KEYWORD
nonn,easy
AUTHOR
Ian Stewart, Aug 08 2010
EXTENSIONS
More terms from R. J. Mathar, Aug 14 2010
STATUS
approved