%I #37 Feb 19 2024 01:51:44
%S 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,
%T 3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4,
%U 5,6,7,8,1,2,3,4,5,6,7,8,1
%N Simple periodic sequence: repeat 1,2,3,4,5,6,7,8.
%C Partial sums are given by A130486(n)+n+1. - _Hieronymus Fischer_, Jun 08 2007
%C 1371742/11111111 = 0.123456781234567812345678... - _Eric Desbiaux_, Nov 03 2008
%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1).
%F a(n) = 1 + (n mod 8) - _Paolo P. Lava_, Nov 21 2006
%F From _Hieronymus Fischer_, Jun 08 2007: (Start)
%F a(n) = (1/2)*(9 - (-1)^n - 2*(-1)^(b/4) - 4*(-1)^((b - 2 + 2*(-1)^(b/4))/8)) where b = 2n - 1 + (-1)^n.
%F Also a(n) = A010877(n) + 1.
%F G.f.: g(x) = (1/(1-x^8))*Sum_{k=0..7} (k+1)*x^k.
%F Also: g(x) = (8x^9 - 9x^8 + 1)/((1-x^8)*(1-x)^2). (End)
%t PadRight[{},90,Range[8]] (* _Harvey P. Dale_, May 10 2022 *)
%o (Haskell)
%o a010887 = (+ 1) . flip mod 8
%o a010887_list = cycle [1..8]
%o -- _Reinhard Zumkeller_, Nov 09 2014, Mar 04 2014
%o (Python)
%o def A010887(n): return 1 + (n & 7) # _Chai Wah Wu_, May 25 2022
%Y Cf. A010872, A010873, A010874, A010875, A010876, A010878, A004526, A002264, A002265, A002266.
%Y Cf. A177034 (decimal expansion of (9280+3*sqrt(13493990))/14165). - _Klaus Brockhaus_, May 01 2010
%K nonn,easy
%O 0,2
%A _N. J. A. Sloane_