login
A081594
Let n = 10x + y where 0 <= y <= 9, x >= 0. Then a(n) = 2x+y.
8
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 20
OFFSET
0,3
LINKS
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
A081594:=n->n-8*floor(n/10); seq(A081594(n), n=0..100); # Wesley Ivan Hurt, Jun 25 2014
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
Cf. A081502. Differs from A028897, A156230 and A244158 for the first time at n=100, which here is a(100) = 20.
Sequence in context: A028897 A244158 A322001 * A038506 A091047 A068505
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