OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
From R. J. Mathar, Mar 10 2008: (Start)
a(n) = a(n-4)+8.
O.g.f.: 2/(-1+x)^2+1/(2(x^2+1))+7/(4(-1+x))+1/(4(x+1)). (End)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5. - R. J. Mathar, Feb 11 2010
From Wesley Ivan Hurt, May 22 2016:
a(n) = (8n-7-i^(2n)+i^(1-n)-i^(1+n))/4 where i=sqrt(-1).
E.g.f.: (4 + sin(x) + (4*x - 3)*sinh(x) + 4*(x - 1)*cosh(x))/2. - Ilya Gutkovskiy, May 23 2016
a(n) = (8*n-7-cos(n*Pi)+2*sin(n*Pi/2))/4. - Wesley Ivan Hurt, Oct 05 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+1)*Pi/16 - sqrt(2)*log(3-2*sqrt(2))/16. - Amiram Eldar, Dec 23 2021
MAPLE
A047411 := proc(n) if n <= 4 then op(n, [1, 2, 4, 6]); else procname(n-4)+8; end if; end proc: seq(A047411(n), n=1..99); # R. J. Mathar, Feb 11 2010
MATHEMATICA
Table[(8n-7-I^(2n)+I^(1-n)-I^(1+n))/4, {n, 80}] (* Wesley Ivan Hurt, May 22 2016 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {1, 2, 4, 6, 9}, 50] (* G. C. Greubel, May 23 2016 *)
PROG
(Magma) [n : n in [0..150] | n mod 8 in [1, 2, 4, 6]]; // Wesley Ivan Hurt, May 22 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Extended by R. J. Mathar, Feb 11 2010
STATUS
approved