login
a(n) = a(n-1) + a(n-2) + a(n-3) - a(n-4); a(0)=0, a(1)=1, a(2)=1, a(3)=1.
8

%I #49 Mar 26 2019 15:05:47

%S 0,1,1,1,3,4,7,13,21,37,64,109,189,325,559,964,1659,2857,4921,8473,

%T 14592,25129,43273,74521,128331,220996,380575,655381,1128621,1943581,

%U 3347008,5763829,9925797,17093053,29435671,50690692,87293619,150326929,258875569

%N a(n) = a(n-1) + a(n-2) + a(n-3) - a(n-4); a(0)=0, a(1)=1, a(2)=1, a(3)=1.

%C This is a divisibility sequence; that is, if n divides m then a(n) divides a(m). - _T. D. Noe_, Dec 22 2008

%C This is the case P1 = 1, P2 = -3, Q = 1 of the 3 parameter family of 4th-order linear divisibility sequences found by Williams and Guy. - _Peter Bala_, Mar 31 2014

%C Also, the inverse radii of a family of spheres defined as follows: the first three spheres have radius of 1 and touch each other and the common plane, while each subsequent sphere touches the three immediately preceding ones and the same plane. - _Ivan Neretin_, Sep 11 2018

%H Vincenzo Librandi, <a href="/A116201/b116201.txt">Table of n, a(n) for n = 0..1000</a>

%H A. D. Mednykh, I. A. Mednykh, <a href="http://arxiv.org/abs/1711.00175">The number of spanning trees in circulant graphs, its arithmetic properties and asymptotic</a>, arXiv preprint arXiv:1711.00175 [math.CO], 2017. See Section 4.

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Descartes%27_theorem#Generalizations">Soddy-Gosset theorem</a>.

%H H. C. Williams and R. K. Guy, <a href="http://dx.doi.org/10.1142/S1793042111004587">Some fourth-order linear divisibility sequences</a>, Intl. J. Number Theory 7 (5) (2011) 1255-1277.

%H H. C. Williams and R. K. Guy, <a href="https://www.emis.de/journals/INTEGERS/papers/a17self/a17self.Abstract.html">Some Monoapparitic Fourth Order Linear Divisibility Sequences</a> Integers, Volume 12A (2012) The John Selfridge Memorial Volume

%H <a href="/index/Di#divseq">Index to divisibility sequences</a>

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

%F From _R. J. Mathar_, Mar 31 2008: (Start)

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

%F a(n) = A135431(n) - A135431(n-1). (End)

%F From _Peter Bala_, Mar 31 2014: (Start)

%F a(n) = ( T(n,alpha) - T(n,beta) )/(alpha - beta), where alpha = (1 + sqrt(13))/4 and beta = (1 - sqrt(13))/4 and T(n,x) denotes the Chebyshev polynomial of the first kind.

%F a(n) = the bottom left entry of the 2 X 2 matrix T(n, M), where M is the 2 X 2 matrix [0, 3/4; 1, 1/2].

%F a(n) = U(n-1,(sqrt(3) + i)/4)*U(n-1,(sqrt(3) - i)/4), where U(n,x) denotes the Chebyshev polynomial of the second kind.

%F See the remarks in A100047 for the general connection between Chebyshev polynomials and 4th-order linear divisibility sequences. (End)

%F a(n) = a(-n) = A116732(n+2) - A116732(n), 0 = a(n) - 2*a(n+1) + 2*a(n+4) - a(n+5) for all n in Z. - _Michael Somos_, Feb 26 2019

%e G.f. = x + x^2 + x^3 + 3*x^4 + 4*x^5 + 7*x^6 + 13*x^7 + 21*x^8 + ... - _Michael Somos_, Feb 26 2019

%p a[0]:=0: a[1]:=1: a[2]:=1: a[3]:=1: for n from 4 to 35 do a[n]:= a[n-1]+a[n-2]+a[n-3]-a[n-4] end do: seq(a[n],n=0..35); # _Emeric Deutsch_, Apr 12 2008

%t a = {0, 1, 1, 1, 3}; Do[AppendTo[a, a[[ -1]]+a[[ -2]]+a[[ -3]]-a[[ -4]]], {80}]; a (* _Stefan Steinerberger_, Mar 24 2008 *)

%t CoefficientList[Series[(- x^3 + x)/(x^4 - x^3 - x^2 - x + 1), {x, 0, 50}], x] (* _Vincenzo Librandi_, Apr 02 2014 *)

%t a[ n_] := 1 - SeriesCoefficient[ (1 - 2 x) / (1 - 2 x + 2 x^4 - x^5), {x, 0, Abs@n}]; (* _Michael Somos_, Feb 26 2019 *)

%t LinearRecurrence[{1,1,1,-1},{0,1,1,1},50] (* _Harvey P. Dale_, Mar 26 2019 *)

%o (PARI) {a(n) = n=abs(n); 1 - polcoeff( (1 - 2*x) / (1 - 2*x + 2*x^4 - x^5) + x * O(x^n), n)}; /* _Michael Somos_, Feb 26 2019 */

%Y Cf. A100047, A116732, A135431.

%K nonn,easy

%O 0,5

%A _R. K. Guy_, Mar 23 2008