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.

A180046 a(n+1) = a(n-3) + a(n-2) - a(n-1) + a(n) starting with 1, 2, 3, 4.

Original entry on oeis.org

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

Views

Author

Ian Stewart, Aug 08 2010

Keywords

Examples

			1 2 3 4 (by definition); 1 + 2 - 3 + 4 = 4, 2 + 3 - 4 + 4 = 5, 3 + 4 - 4 + 5 = 8.
		

Crossrefs

Cf. A100329.

Programs

  • 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
  • Mathematica
    LinearRecurrence[{1,-1,1,1},{1,2,3,4},50] (* Harvey P. Dale, Mar 18 2015 *)
  • 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
    

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

Extensions

More terms from R. J. Mathar, Aug 14 2010
Name edited by Michel Marcus, Feb 20 2025