%I M0872 #34 Oct 25 2023 09:30:29
%S 1,2,3,8,13,24,37,66,107,186,303,516,849,1436,2377,3998,6639,11134,
%T 18531,31024,51701,86464,144205,241018,402163,671906,1121463,1873244,
%U 3127129,5222724,8719537,14561622,24312695,40600230,67790379,113201160,189016701,315627944,527024245,880037810,1469467515
%N From a counter moving problem.
%D D. St. P. Barnard, 50 Observer Brain Twisters. Faber and Faber, London, 1962, p. 38.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
%H Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992.
%H A. D. Rawlins and N. J. A. Sloane, <a href="/A004138/a004138.pdf">Correspondence, 1976</a>.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,3,-2).
%F a(n) = a(n-1) + a(n-2) - a(n-3) + 2*a(n-4) + 2 for n >= 5. [Rawlins]
%F G.f. = -(-1+z^2-4*z^3+2*z^4)/((z-1)*(2*z^4-z^3+z^2+z-1)). [Conjectured (correctly) by _Simon Plouffe_ in his 1992 dissertation.]
%p f:=proc(n) option remember;
%p if n <= 3 then n
%p elif n=4 then 8
%p else 2+f(n-1)+f(n-2)-f(n-3)+2*f(n-4); fi; end;
%p [seq(f(n),n=1..60)];
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_
%E Entry revised by _N. J. A. Sloane_, Jun 29 2017