OFFSET
1,1
LINKS
David Lovler, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
G.f.: x*(4+x+3*x^2) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Sep 22 2016
a(n) = 4n - 3*(1 + (-1)^n)/2 or a(n) = 4n - 3*((n-1) mod 2). - Heinz Ebert, Jul 12 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)-1)*Pi/16 - log(2)/4 + sqrt(2)*log(sqrt(2)+1)/8. - Amiram Eldar, Dec 19 2021
E.g.f.: 3 + ((8*x - 3)*exp(x) - 3*exp(-x))/2. - David Lovler, Aug 20 2022
MATHEMATICA
Select[Range[230], MemberQ[{4, 5}, Mod[#, 8]] &] (* Amiram Eldar, Dec 19 2021 *)
PROG
(PARI) a(n) = 4n - 3*(1 + (-1)^n)/2 \\ David Lovler, Aug 20 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved