%I #23 Sep 08 2022 08:44:57
%S 0,2,4,5,8,10,12,13,16,18,20,21,24,26,28,29,32,34,36,37,40,42,44,45,
%T 48,50,52,53,56,58,60,61,64,66,68,69,72,74,76,77,80,82,84,85,88,90,92,
%U 93,96,98,100,101,104,106,108,109,112,114,116,117,120,122,124
%N Numbers that are congruent to {0, 2, 4, 5} mod 8.
%H Bruno Berselli, <a href="/A047612/b047612.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).
%F From _Bruno Berselli_, Jul 18 2012: (Start)
%F G.f.: x^2*(2+2*x+x^2+3*x^3)/((1+x)*(1-x)^2*(1+x^2)).
%F a(n) = 2*n-2-(1+(-1)^n)*(1+i^n)/4, where i=sqrt(-1). (End)
%F From _Wesley Ivan Hurt_, Jun 02 2016: (Start)
%F a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
%F a(2k) = A047617(k), a(2k-1) = A008586(k-1) for k>0. (End)
%F E.g.f.: (6 - cos(x) + 4*(x - 1)*sinh(x) + (4*x - 5)*cosh(x))/2. - _Ilya Gutkovskiy_, Jun 03 2016
%F Sum_{n>=2} (-1)^n/a(n) = (2-sqrt(2))*Pi/16 + 5*log(2)/8 + sqrt(2)*log(sqrt(2)-1)/8. - _Amiram Eldar_, Dec 21 2021
%p A047612:=n->2*n-2-(1+I^(2*n))*(1+I^n)/4: seq(A047612(n), n=1..100); # _Wesley Ivan Hurt_, Jun 02 2016
%t Select[Range[0,120], MemberQ[{0, 2, 4, 5}, Mod[#, 8]] &] (* or *) LinearRecurrence[{1, 0, 0, 1, -1}, {0, 2, 4, 5, 8}, 60] (* _Bruno Berselli_, Jul 18 2012 *)
%o From _Bruno Berselli_, Jul 18 2012: (Start)
%o (Magma) [n: n in [0..120] | n mod 8 in [0,2,4,5]];
%o (Maxima) makelist(2*n-2-(1+(-1)^n)*(1+%i^n)/4,n,1,60);
%o (PARI) concat(0, Vec((2+2*x+x^2+3*x^3)/((1+x)*(1-x)^2*(1+x^2))+O(x^60))) (End)
%Y Cf. A008586, A047617.
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_