%I #31 Dec 12 2023 07:47:21
%S 4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,
%T 8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,
%U 6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8,4,4,8,6,8
%N Period 5: repeat 4,4,8,6,8.
%C This is also the post-period decimal digit of ((n+2)^2-2)/5.
%C Serves also as the decimal expansion of 1495600/33333 and as the continued fraction representation of (33397+sqrt(12952802))/1649.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,1).
%F a(n) = (2*n^2 + 8*n + 4) mod 10.
%F From _Wesley Ivan Hurt_, Sep 06 2014: (Start)
%F G.f.: 2*(2 + 2*x + 4*x^2 + 3*x^3 + 4*x^4)/(1-x^5). [corrected by _Georg Fischer_, May 11 2019]
%F Recurrence: a(n) = a(n-5).
%F a(n) = (2*A008865(n+1)) mod 10.
%F a(n) = (-A147973(n+4)) mod 10.
%F a(n+1) = 2*A053796(n) + 4. (End)
%p A165662:=n->2*n^2+8*n+4 mod 10: seq(A165662(n), n=0..100); # _Wesley Ivan Hurt_, Sep 06 2014
%t Table[Mod[2 n^2 + 8 n + 4, 10], {n, 0, 100}] (* _Wesley Ivan Hurt_, Sep 06 2014 *)
%t CoefficientList[Series[2 (2 + 2 x + 4 x^2 + 3 x^3 + 4 x^4)/(1 - x^5), {x, 0, 30}], x] (* _Wesley Ivan Hurt_, Sep 06 2014 *)
%o (Magma) [(2*n^2+8*n+4) mod 10 : n in [0..100]]; // _Wesley Ivan Hurt_, Sep 06 2014
%o (PARI) a(n)=[4,4,8,6,8][n%5+1] \\ _Edward Jiang_, Sep 06 2014
%Y Cf. A008865, A053796, A147973.
%K nonn,easy,less
%O 0,1
%A _Vincenzo Librandi_, Sep 24 2009
%E Definition simplified, offset corrected by _R. J. Mathar_, Sep 25 2009
%E Name and offset changed by _Wesley Ivan Hurt_, Sep 06 2014