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.
%I A107386 #20 Dec 07 2021 16:49:47 %S A107386 0,1,1,2,2,7,9,16,20,29,35,46,54,67,77,92,104,121,135,154,170,191,209, %T A107386 232,252,277,299,326,350,379,405,436,464,497,527,562,594,631,665,704, %U A107386 740,781,819,862,902,947,989,1036,1080,1129 %N A107386 a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4), n>6. %H A107386 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1). %F A107386 For n>=4, a(n) = (n-2)^2 - a(n-1). - _Alex Ratushnyak_, Aug 03 2012 %F A107386 G.f.: x*(-4*x^4+2*x^5+x-1)/((1+x)*(x-1)^3). - _N. J. A. Sloane_, Sep 28 2009 %F A107386 a(n)= n^2/2-3*n/2+1-(-1)^n, n>2. - _N. J. A. Sloane_, Sep 28 2009 %t A107386 Clear[M, m, v, aa] (*A107386*)m = 2; M = {{0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {1, m, 0, - m}};Expand[Det[M - x*IdentityMatrix[4]]] ;NSolve[Det[M - x*IdentityMatrix[4]] == 0, x] ;v[1] = {0, 1, 1, 2}; v[n_] := v[n] = M . v[n - 1]; digits = 50; aa = Table[Abs[v[n][[1]]], {n, 1, digits}] %t A107386 a=2; lst={0, 1, 1, a}; Do[a=n^2-a; AppendTo[lst, a], {n, 2, 5!}]; lst (* _Vladimir Joseph Stephan Orlovsky_, Dec 17 2008 *) %t A107386 LinearRecurrence[{2,0,-2,1},{0,1,1,2,2,7,9},50] (* _Harvey P. Dale_, Dec 07 2021 *) %Y A107386 Cf. A107387, A107388, A107389. %K A107386 nonn,easy %O A107386 0,4 %A A107386 _Roger L. Bagula_, May 24 2005, corrected Sep 04 2008 %E A107386 Definition replaced by recurrence by the Associate Editors of the OEIS, Sep 28 2009