%I M0030 #61 Apr 18 2024 06:24:19
%S 0,0,1,2,0,-4,0,16,16,-32,-64,64,256,0,-768,-512,2048,3072,-4096,
%T -12288,4096,40960,16384,-114688,-131072,262144,589824,-393216,
%U -2097152,-262144,6291456,5242880,-15728640,-27262976,29360128,104857600,-16777216
%N Berstel sequence: a(n+1) = 2*a(n) - 4*a(n-1) + 4*a(n-2).
%C a(n) = 0 only for n = 0,1,4,6,13 and 52. [Cassels, following Mignotte. See also Beukers] - _N. J. A. Sloane_, Aug 29 2010
%D J. W. S. Cassels, Local Fields, Cambridge, 1986, see p. 67.
%D G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; p. 28.
%D J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 193.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H T. D. Noe, <a href="/A007420/b007420.txt">Table of n, a(n) for n = 0..500</a>
%H F. Beukers, <a href="http://www.numdam.org/item?id=CM_1991__77_2_165_0">The zero-multiplicity of ternary recurrences</a>, Compositio Math. 77 (1991), 165-177.
%H Daniel Birmajer, Juan B. Gil, and Michael D. Weiner, <a href="http://arxiv.org/abs/1505.06339">Linear recurrence sequences with indices in arithmetic progression and their sums</a>, arXiv:1505.06339 [math.NT], 2015.
%H M. Mignotte, <a href="http://www.numdam.org/item/?id=SDPP_1973-1974__15_2_A9_0">Suites récurrentes linéaires</a>, Sém. Delange-Pisot-Poitou, 15th year (1973/1974), No. 14, 9 pages.
%H G. Myerson and A. J. van der Poorten, <a href="http://www.jstor.org/stable/2974639">Some problems concerning recurrence sequences</a>, Amer. Math. Monthly 102 (1995), no. 8, 698-705.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,-4,4).
%F G.f.: x^2/(1-2*x+4*x^2-4*x^3).
%F a(0)=0, a(1)=0, a(2)=1, a(n) = 2*a(n-1)-4*a(n-2)+4*a(n-3). - _Harvey P. Dale_, Jun 24 2015
%p A007420 := proc(n) options remember; if n <=1 then 0 elif n=2 then 1 else 2*A007420(n-1)-4*A007420(n-2)+4*A007420(n-3); fi; end;
%t a[0] = a[1] = 0; a[2] = 1; a[n_] := a[n] = 2*a[n - 1] - 4*a[n - 2] + 4*a[n - 3]; a /@ Range[0, 34] (* _Jean-François Alcover_, Apr 06 2011 *)
%t LinearRecurrence[{2, -4, 4}, {0, 0, 1}, 40] (* _Harvey P. Dale_, Oct 24 2011 *)
%t Table[RootSum[-4 + 4 # - 2 #^2 + #^3 &, 6 #^n - #^(n + 1) + 4 #^(n + 1) &]/44, {n, 0, 20}] (* _Eric W. Weisstein_, Nov 09 2017 *)
%o (Haskell)
%o a007420 n = a007420_list !! n
%o a007420_list = 0 : 0 : 1 : (map (* 2) $ zipWith (+) (drop 2 a007420_list)
%o (map (* 2) $ zipWith (-) a007420_list (tail a007420_list)))
%o -- _Reinhard Zumkeller_, Oct 21 2011
%o (Magma) I:=[0,0,1]; [n le 3 select I[n] else 2*Self(n-1)-4*Self(n-2)+4*Self(n-3): n in [1..70]]; // _Vincenzo Librandi_, Oct 05 2015
%o (PARI) a(n)=([0,1,0; 0,0,1; 4,-4,2]^n*[0;0;1])[1,1] \\ _Charles R Greathouse IV_, Feb 19 2017
%Y Cf. A035302, A077953.
%K sign,easy,nice
%O 0,4
%A _N. J. A. Sloane_