login
Period 16: repeat (1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2).
1

%I #26 Sep 08 2022 08:46:14

%S 1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,2,

%T 3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,2,3,4,

%U 5,6,7,8,9,8,7,6,5,4,3,2,1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,1,2,3,4,5,6,7,8,9

%N Period 16: repeat (1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2).

%C Decimal expansion of 111111112/900000009.

%C For n which lies in the interval [16*(k-1), 8*(2*k-1)], where k>0 -> pattern {1, 2, 3, 4, 5, 6, 7, 8, 9}; for n which lies in the interval [16*k - 7, 16*k - 1], where k>0 -> pattern {8, 7, 6, 5, 4, 3, 2}.

%H Colin Barker, <a href="/A262734/b262734.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,-1,1).

%F -1 + a(16*(k - 1)) = -2 + a(8*k + 3*(-1)^k - 4) = -3 + a(2*(4*k + (-1)^k - 2)) = -4 + a(8*k + (-1)^k - 4) = -5 + a(4*(2*k - 1)) = -6 + a(8*k - (-1)^k - 4) = -7 + a(-2*(-4*k + (-1)^k + 2)) = -8 + a(8*k - 3*(-1)^k - 4) = -9 + a(8*(2*k - 11)) = 0, for k>0.

%F a(0) = 1, a(n) = a(n+1) - 1, for 16*(k - 1) <= n < 8*(2*k - 1), and a(n) = a(n + 1) + 1, for (8*(2*k - 1) <= n < 16*(k-1), where k>0.

%F From _Colin Barker_, Sep 29 2015: (Start)

%F a(n) = a(n-1) - a(n-8) + a(n-9) for n>8.

%F G.f.: -(2*x^8+x^7+x^6+x^5+x^4+x^3+x^2+x+1) / ((x-1)*(x^8+1)).

%F (End)

%t LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, -1 ,1}, {1, 2, 3, 4, 5, 6, 7, 8, 9}, 120] (* _Vincenzo Librandi_, Sep 29 2015 *)

%o (PARI) Vec(-(2*x^8+x^7+x^6+x^5+x^4+x^3+x^2+x+1)/((x-1)*(x^8+1)) + O(x^100)) \\ _Colin Barker_, Sep 29 2015

%o (Magma) &cat[[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2]: n in [0..10]]; // _Vincenzo Librandi_, Sep 29 2015

%o (PARI) 111111112/900000009. \\ _Altug Alkan_, Sep 29 2015

%o (PARI) vector(200, n, default(realprecision, n+2); floor(111111112/900000009*10^n)%10) \\ _Altug Alkan_, Nov 12 2015

%Y Cf. A158289, A177274, A010889, A138531, A181975, A199264, A068073, A028356.

%K nonn,easy

%O 0,2

%A _Ilya Gutkovskiy_, Sep 29 2015