OFFSET
0,1
COMMENTS
Invert blocks of five in the sequence of natural numbers.
LINKS
Eric Weisstein's World of Mathematics, Natural Number
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
FORMULA
G.f.: (5 - x - x^2 - x^3 - x^4 + 4*x^5)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4)).
a(n) = a(n-1) + a(n-5) - a(n-6) for n>5.
a(n) = 5 + 5*floor(n/5) - n mod 5.
a(n) = n+1+2*A257145(n+3). - R. J. Mathar, Apr 12 2019
MATHEMATICA
Table[5 + 5 Floor[n/5] - Mod[n, 5], {n, 0, 50}]
CoefficientList[Series[(5 - x - x^2 - x^3 - x^4 + 4 x^5)/(x^6 - x^5 - x + 1), {x, 0, 50}], x] (* Vincenzo Librandi, Dec 21 2015 *)
Reverse/@Partition[Range[80], 5]//Flatten (* or *) LinearRecurrence[ {1, 0, 0, 0, 1, -1}, {5, 4, 3, 2, 1, 10}, 80] (* Harvey P. Dale, Sep 02 2016 *)
PROG
(Magma) [5+5*Floor(n/5)-n mod 5: n in [0..70]]; // Vincenzo Librandi, Dec 21 2015
(PARI) a(n) = 5 + 5*(n\5) - (n % 5); \\ Michel Marcus, Dec 21 2015
(PARI) x='x+O('x^100); Vec((5-x-x^2-x^3-x^4+4*x^5)/(x^6-x^5-x+1)) \\ Altug Alkan, Dec 21 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Dec 21 2015
STATUS
approved