OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..2000
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1).
FORMULA
a(n) = (2 * floor(n/10)) + (n modulo 10). - Antti Karttunen, Jun 22 2014
G.f.: -x*(7*x^9 -x^8 -x^7 -x^6 -x^5 -x^4 -x^3 -x^2 -x -1) / ((x -1)^2*(x +1)*(x^4 -x^3 +x^2 -x +1)*(x^4 +x^3 +x^2 +x +1)). - Colin Barker, Jun 23 2014
a(n) = n - 8*floor(n/10). [Bruno Berselli, Jun 24 2014]
MAPLE
MATHEMATICA
CoefficientList[Series[-x (7 x^9 - x^8 - x^7 - x^6 - x^5 - x^4 - x^3 - x^2 - x - 1)/((x - 1)^2 (x + 1) (x^4 - x^3 + x^2 - x+1) (x^4 + x^3 + x^2 + x + 1)), {x, 0, 150}], x] (* Vincenzo Librandi, Jun 25 2014 *)
LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2}, 110] (* or *) Table[Range[n, n+9], {n, 0, 26, 2}]//Flatten (* Harvey P. Dale, Jul 22 2021 *)
PROG
(MIT/GNU Scheme) (define (A081594 n) (+ (* 2 (floor->exact (/ n 10))) (modulo n 10))) ;; Antti Karttunen, Jun 22 2014
(PARI) my(n, x, y); vector(200, n, y=(n-1)%10; x=(n-1-y)\10; 2*x+y) \\ Colin Barker, Jun 24 2014
(Magma) [(n+4*y)/5 where y is n mod 10: n in [0..100]]; // Bruno Berselli, Jun 24 2014
(Sage) [n-8*floor(n/10) for n in (0..100)] # Bruno Berselli, Jun 24 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Apr 22 2003
EXTENSIONS
Terms up to n=100 added by Antti Karttunen, Jun 22 2014
G.f. revised by Vincenzo Librandi, Jun 25 2014
STATUS
approved