OFFSET
0,2
COMMENTS
Old name was: a(n) = 4*a(n-1) + A042968(n), with a(0) = 1, where A042968 = "not divisible by 4": (1, 2, 3, 5, 6, 7, 9, 10, 11, ...). After the correction of a(13) the definition could be simplified. - N. J. A. Sloane, Aug 23 2018
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..1660
Index entries for linear recurrences with constant coefficients, signature (5, -4, 1, -5, 4).
FORMULA
a(n) = 5*a(n-1) - 4*a(n-2) + a(n-3) - 5*a(n-4) + 4*a(n-5) for n>4. - Colin Barker, Jun 26 2017
EXAMPLE
MATHEMATICA
CoefficientList[Series[(1 + x) (1 + x^2) / ((1 - x)^2 (1 + x + x^2) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 28 2017 *)
Nest[Append[#, Block[{k = #[[-1, -1]] + 1}, While[Mod[k, 4] == 0, k++]; {4 #[[-1, 1]] + k, k}]] &, {{1, 1}}, 24][[All, 1]] (* Michael De Vlieger, Jun 30 2018 *)
LinearRecurrence[{5, -4, 1, -5, 4}, {1, 6, 27, 113, 458}, 25] (* Robert G. Wilson v, Jul 28 2018 *)
PROG
(PARI) Vec((1 + x)*(1 + x^2) / ((1 - x)^2*(1 - 4*x)*(1 + x + x^2)) + O(x^30)) \\ Colin Barker, Jun 26 2017
(Magma) I:=[1, 6, 27, 113, 458]; [n le 5 select I[n] else 5*Self(n-1)-4*Self(n-2)+Self(n-3)-5*Self(n-4)+4*Self(n-5): n in [1..30]]; // Vincenzo Librandi, Jun 28 2017, Jul 28 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Jul 11 2008
EXTENSIONS
Corrected by Charlie Neder, Jun 22 2018
Edited by N. J. A. Sloane, Aug 23 2018, merging old entry A288571 with this one.
STATUS
approved